Skip to content

Commit ed37fa4

Browse files
committed
Refactor: represent LockInfo timeout as an Instant in toString and adjust security exception logging based on cause type.
1 parent ade74df commit ed37fa4

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎wise-api/src/main/java/com/wisemapping/config/GlobalExceptionHandler.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,13 @@ public RestErrors handleHttpMessageNotReadableException(
196196
@ResponseStatus(HttpStatus.BAD_REQUEST)
197197
@ResponseBody
198198
public RestErrors handleSecurityErrors(@NotNull UndeclaredThrowableException ex) {
199-
logger.error(ex.getMessage(), ex);
200199
final Throwable cause = ex.getCause();
201200
RestErrors result;
202201
if (cause instanceof ClientException) {
202+
logger.debug("Expected exception handled: {}", cause.getMessage());
203203
result = handleClientErrors((ClientException) cause);
204204
} else {
205+
logger.error(ex.getMessage(), ex);
205206
result = new RestErrors(ex.getMessage(), Severity.INFO);
206207
}
207208
return result;

‎wise-api/src/main/java/com/wisemapping/service/LockInfo.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void updateTimeout() {
6464
public String toString() {
6565
return "LockInfo{" +
6666
"user=" + user +
67-
", timeout=" + timeout +
67+
", timeout=" + (timeout != null ? timeout.toInstant() : null) +
6868
", mapId=" + mapId +
6969
'}';
7070
}

0 commit comments

Comments
 (0)