Skip to content

Commit

Permalink
fix: Internal Server에러 client-response 형태 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
GaHee99 committed Jun 9, 2024
1 parent dee4963 commit 52e2d48
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/com/gam/api/common/ErrorHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ public ResponseEntity<Object> handleException(Exception exception, HttpServletRe
val errorDTO = requestToDTO(exception, request);
sendSlackAlarm(errorDTO.toString());

return new ResponseEntity<>(errorDTO, HttpStatus.INTERNAL_SERVER_ERROR);
ApiResponse response = ApiResponse.serverError(errorDTO);
return new ResponseEntity<>(response, HttpStatus.INTERNAL_SERVER_ERROR);
}

@ExceptionHandler(RuntimeException.class)
public ResponseEntity<Object> handleRuntimeException(RuntimeException exception, HttpServletRequest request) {
val errorDTO = requestToDTO(exception, request);
sendSlackAlarm(errorDTO.toString());
return new ResponseEntity<>(errorDTO, HttpStatus.INTERNAL_SERVER_ERROR);

ApiResponse response = ApiResponse.serverError(errorDTO);
return new ResponseEntity<>(response, HttpStatus.INTERNAL_SERVER_ERROR);
}


Expand Down

0 comments on commit 52e2d48

Please sign in to comment.