Skip to content

Commit fd4172b

Browse files
committed
Changed ex to e
1 parent 04f03f4 commit fd4172b

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

src/main/java/com/uid2/operator/service/UIDOperatorService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public RefreshResponse refreshIdentity(RefreshToken token) {
116116
} else {
117117
return RefreshResponse.Optout;
118118
}
119-
} catch (Exception ex) {
119+
} catch (Exception e) {
120120
return RefreshResponse.Invalid;
121121
}
122122
}

src/main/java/com/uid2/operator/service/V2RequestUtil.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static V2Request parseRequest(String bodyString, ClientKey ck) {
6262
// byte 13-end: encrypted payload + GCM AUTH TAG
6363
bodyBytes = Utils.decodeBase64String(bodyString);
6464
}
65-
catch (IllegalArgumentException ex) {
65+
catch (IllegalArgumentException e) {
6666
return new V2Request("Invalid body: Body is not valid base64.");
6767
}
6868

@@ -77,7 +77,7 @@ public static V2Request parseRequest(String bodyString, ClientKey ck) {
7777
byte[] decryptedBody;
7878
try {
7979
decryptedBody = AesGcm.decrypt(bodyBytes, 1, ck.getSecretBytes());
80-
} catch (Exception ex) {
80+
} catch (Exception e) {
8181
return new V2Request("Invalid body: Check encryption key (ClientSecret)");
8282
}
8383

@@ -98,8 +98,8 @@ public static V2Request parseRequest(String bodyString, ClientKey ck) {
9898
// Skip 8 bytes timestamp, 8 bytes nonce
9999
String bodyStr = new String(decryptedBody, 16, decryptedBody.length - 16, StandardCharsets.UTF_8);
100100
payload = new JsonObject(bodyStr);
101-
} catch (Exception ex) {
102-
LOGGER.error("Invalid payload in body: Data is not valid json string.", ex);
101+
} catch (Exception e) {
102+
LOGGER.error("Invalid payload in body: Data is not valid json string.", e);
103103
return new V2Request("Invalid payload in body: Data is not valid json string.");
104104
}
105105
}
@@ -116,7 +116,7 @@ public static V2Request parseRefreshRequest(String bodyString, IKeyStore keyStor
116116
// byte 5-N: IV + encrypted body + GCM AUTH TAG
117117
bytes = Utils.decodeBase64String(bodyString);
118118
}
119-
catch (IllegalArgumentException ex) {
119+
catch (IllegalArgumentException e) {
120120
return new V2Request("Invalid body: Body is not valid base64.");
121121
}
122122

@@ -131,8 +131,8 @@ public static V2Request parseRefreshRequest(String bodyString, IKeyStore keyStor
131131
byte[] decrypted;
132132
try {
133133
decrypted = AesGcm.decrypt(bytes, 5, key);
134-
} catch (Exception ex) {
135-
LOGGER.error("Invalid data: Check encryption method and encryption key", ex);
134+
} catch (Exception e) {
135+
LOGGER.error("Invalid data: Check encryption method and encryption key", e);
136136
return new V2Request("Invalid data: Check encryption method and encryption key");
137137
}
138138

@@ -142,8 +142,8 @@ public static V2Request parseRefreshRequest(String bodyString, IKeyStore keyStor
142142
String refreshToken = tokenJson.getString("refresh_token");
143143

144144
return new V2Request(null, refreshToken, responseKey);
145-
} catch (Exception ex) {
146-
LOGGER.error("Invalid format: Payload is not valid json or missing required data", ex);
145+
} catch (Exception e) {
146+
LOGGER.error("Invalid format: Payload is not valid json or missing required data", e);
147147
return new V2Request("Invalid format: Payload is not valid json or missing required data");
148148
}
149149
}

src/main/java/com/uid2/operator/store/CloudSyncOptOutStore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public static class IndexUpdateMessage {
172172
public static IndexUpdateMessage fromJsonString(String str) {
173173
try {
174174
return IndexUpdateMessage.mapper.readValue(str, IndexUpdateMessage.class);
175-
} catch (JsonProcessingException ex) {
175+
} catch (JsonProcessingException e) {
176176
// IndexUpdateMessage is an internal message, any serialization and deserialization exception is logic error
177177
// return null here
178178
return null;
@@ -182,7 +182,7 @@ public static IndexUpdateMessage fromJsonString(String str) {
182182
public String toJsonString() {
183183
try {
184184
return IndexUpdateMessage.mapper.writeValueAsString(this);
185-
} catch (JsonProcessingException ex) {
185+
} catch (JsonProcessingException e) {
186186
// IndexUpdateMessage is an internal message, any serialization and deserialization exception is logic error
187187
// return null here
188188
return null;

src/main/java/com/uid2/operator/vertx/UIDOperatorVerticle.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,8 @@ private void handleOptOutGet(RoutingContext rc) {
638638
rc.response().setStatusCode(200)
639639
.setChunked(true)
640640
.write(String.valueOf(timestamp));
641-
} catch (Exception ex) {
642-
LOGGER.error("Unexpected error while handling optout get", ex);
641+
} catch (Exception e) {
642+
LOGGER.error("Unexpected error while handling optout get", e);
643643
rc.fail(500);
644644
}
645645
} else {
@@ -738,8 +738,8 @@ private void handleIdentityMap(RoutingContext rc) {
738738
rc.fail(400);
739739
}
740740
}
741-
catch (Exception ex) {
742-
LOGGER.error("Unexpected error while mapping identity", ex);
741+
catch (Exception e) {
742+
LOGGER.error("Unexpected error while mapping identity", e);
743743
rc.fail(500);
744744
}
745745
}
@@ -1081,8 +1081,8 @@ private static String getApiContact(RoutingContext rc) {
10811081
try {
10821082
apiContact = (String) rc.data().get(AuthMiddleware.API_CONTACT_PROP);
10831083
apiContact = apiContact == null ? "unknown" : apiContact;
1084-
} catch (Exception ex) {
1085-
apiContact = "error: " + ex.getMessage();
1084+
} catch (Exception e) {
1085+
apiContact = "error: " + e.getMessage();
10861086
}
10871087

10881088
return apiContact;

src/main/java/com/uid2/operator/vertx/V2PayloadHandler.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public void handleTokenGenerate(RoutingContext rc, Handler<RoutingContext> apiHa
9898

9999
writeResponse(rc, request.nonce, respJson, request.encryptionKey);
100100
}
101-
catch (Exception ex){
102-
LOGGER.error("Failed to generate token", ex);
101+
catch (Exception e){
102+
LOGGER.error("Failed to generate token", e);
103103
ResponseUtil.Error(UIDOperatorVerticle.ResponseStatus.GenericError, 500, rc, "");
104104
}
105105
}
@@ -151,8 +151,8 @@ public void handleTokenRefresh(RoutingContext rc, Handler<RoutingContext> apiHan
151151
.end(respJson.encode());
152152
}
153153
}
154-
catch (Exception ex){
155-
LOGGER.error("Failed to refresh token", ex);
154+
catch (Exception e){
155+
LOGGER.error("Failed to refresh token", e);
156156
ResponseUtil.Error(UIDOperatorVerticle.ResponseStatus.GenericError, 500, rc, "");
157157
}
158158
}
@@ -187,8 +187,8 @@ private void handleResponse(RoutingContext rc, V2RequestUtil.V2Request request)
187187
JsonObject respJson = (JsonObject) rc.data().get("response");
188188

189189
writeResponse(rc, request.nonce, respJson, request.encryptionKey);
190-
} catch (Exception ex) {
191-
LOGGER.error("Failed to generate response", ex);
190+
} catch (Exception e) {
191+
LOGGER.error("Failed to generate response", e);
192192
ResponseUtil.Error(UIDOperatorVerticle.ResponseStatus.GenericError, 500, rc, "");
193193
}
194194
}

src/test/java/com/uid2/operator/UIDOperatorVerticleTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ private void decodeV2RefreshToken(JsonObject respJson) {
294294
private JsonObject tryParseResponse(HttpResponse resp) {
295295
try {
296296
return resp.bodyAsJsonObject();
297-
} catch (Exception ex) {
297+
} catch (Exception e) {
298298
return null;
299299
}
300300
}

0 commit comments

Comments
 (0)