Skip to content

Commit

Permalink
[Test] error log #232
Browse files Browse the repository at this point in the history
  • Loading branch information
wken5577 committed Oct 6, 2023
1 parent 5fef4ff commit 5a99e58
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,23 @@ protected ResponseEntity<ErrorResponse> httpRequestMethodNotSupportedExceptionHa
return new ResponseEntity<>(response, HttpStatus.INTERNAL_SERVER_ERROR);
}

// @ExceptionHandler({RuntimeException.class})
// public ResponseEntity<ErrorResponse> runtimeException(RuntimeException ex) {
// log.error("처리되지 않은 에러입니다.", ex);
// ErrorResponse response = new ErrorResponse(ErrorCode.INTERNAL_SERVER_ERR);
// return new ResponseEntity<>(response, HttpStatus.valueOf(response.getStatus()));
// }
@ExceptionHandler({RuntimeException.class})
public ResponseEntity<ErrorResponse> runtimeException(RuntimeException ex) {
log.error("처리되지 않은 에러입니다. : " + ex.getMessage(), ex);
ErrorResponse response = new ErrorResponse(ErrorCode.INTERNAL_SERVER_ERR);
return new ResponseEntity<>(response, HttpStatus.valueOf(response.getStatus()));
}
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
protected ResponseEntity<ErrorResponse> httpRequestMethodNotSupportedExceptionHandle(HttpRequestMethodNotSupportedException ex) {
log.error("지원하지 않는 메소드 요청입니다.", ex.getMethod());
ErrorResponse response = new ErrorResponse(ErrorCode.METHOD_NOT_ALLOWED);
return new ResponseEntity<>(response, HttpStatus.METHOD_NOT_ALLOWED);
}
// @ExceptionHandler(Exception.class)
// public ResponseEntity<ErrorResponse> handleException(Exception ex) {
// log.error("!!!!!! SERVER ERROR !!!!!!", ex.getMessage());
// ErrorResponse response = new ErrorResponse(ErrorCode.INTERNAL_SERVER_ERR);
// return new ResponseEntity<>(response, HttpStatus.valueOf(response.getStatus()));
// }
@ExceptionHandler(Exception.class)
public ResponseEntity<ErrorResponse> handleException(Exception ex) {
log.error("!!!!!! SERVER ERROR !!!!!!", ex.getMessage());
ErrorResponse response = new ErrorResponse(ErrorCode.INTERNAL_SERVER_ERR);
return new ResponseEntity<>(response, HttpStatus.valueOf(response.getStatus()));
}

}

0 comments on commit 5a99e58

Please sign in to comment.