Skip to content

Commit

Permalink
chore: bad request 시 error response 형식 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kimdoha committed Jan 6, 2024
1 parent 2d3732f commit 6256fd3
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ public ResponseEntity<ErrorResponse> handleMethodArgumentNotValidException(

return ResponseEntity
.status(HttpStatus.BAD_REQUEST)
.body(ErrorResponse.from(ErrorCode.BAD_REQUEST));
.body(ErrorResponse.builder()
.result(false)
.status(HttpStatus.BAD_REQUEST.value())
.message(exception.getMessage())
.build()
);
}

@ExceptionHandler(value = { Exception.class, RuntimeException.class, SQLException.class })
@ExceptionHandler(value = {Exception.class, RuntimeException.class, SQLException.class})
public ResponseEntity<ErrorResponse> handleInternalException(
final Exception exception
) {
Expand Down

0 comments on commit 6256fd3

Please sign in to comment.