Skip to content

Commit c2ff573

Browse files
committed
fixed #379 Error Controller is broken
1 parent ee9db79 commit c2ff573

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/woehlke/java/simpleworklist/domain/ApplicationErrorController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ public String handleError(
2727
String errorMessage = (String) request.getAttribute(ERROR_MESSAGE);
2828
if(errorMessage!=null){
2929
errorMessage = errorMessage.strip();
30-
log.warn("handleError - errorMessage: "+errorMessage);
30+
if(!errorMessage.isEmpty()) {
31+
log.warn("handleError - errorMessage: " + errorMessage);
32+
}
3133
}
3234
Integer statusCode = (Integer) request.getAttribute(ERROR_STATUS_CODE);
3335
if(statusCode != null){
3436
HttpStatus httpStatus = HttpStatus.valueOf(statusCode);
35-
log.warn(httpStatus.value()+" "+httpStatus.getReasonPhrase());
37+
log.warn("handleError - HTTP Code: " +httpStatus.value()+" "+httpStatus.getReasonPhrase());
3638
String redirectLoginPageWithError = "redirect:/user/login?login_error=1";
3739
switch (httpStatus){
3840
case NOT_FOUND:

0 commit comments

Comments
 (0)