Skip to content

Commit

Permalink
refactor: forbidden 예외 핸들러 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
nayonsoso committed Feb 15, 2025
1 parent 649ee0d commit 4e9679e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import reviewme.global.exception.BadRequestException;
import reviewme.global.exception.DataInconsistencyException;
import reviewme.global.exception.FieldErrorResponse;
import reviewme.global.exception.ForbiddenException;
import reviewme.global.exception.NotFoundException;
import reviewme.global.exception.UnauthorizedException;

Expand All @@ -45,6 +46,11 @@ public ProblemDetail handleUnauthorizedException(UnauthorizedException ex) {
return ProblemDetail.forStatusAndDetail(HttpStatus.UNAUTHORIZED, ex.getErrorMessage());
}

@ExceptionHandler(ForbiddenException.class)
public ProblemDetail handleForbiddenException(UnauthorizedException ex) {
return ProblemDetail.forStatusAndDetail(HttpStatus.FORBIDDEN, ex.getErrorMessage());
}

@ExceptionHandler(DataInconsistencyException.class)
public ProblemDetail handleDataConsistencyException(DataInconsistencyException ex) {
return ProblemDetail.forStatusAndDetail(HttpStatus.INTERNAL_SERVER_ERROR, ex.getErrorMessage());
Expand Down

0 comments on commit 4e9679e

Please sign in to comment.