Skip to content

Commit

Permalink
fix: HTTp Status Code 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
daeyoung0726 committed Aug 2, 2024
1 parent a1005fe commit 31b595b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
} catch (ExpiredJwtException e){
log.info("expiredJwtEcxeption");
ErrorType errorType = ErrorType.TOKEN_EXPIRED;
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
response.getWriter().write(objectMapper.writeValueAsString(ErrorRes.of(errorType.getStatus(), errorType.getMessage())));
} catch (JwtException e){
log.info("JwtException");
ErrorType errorType = ErrorType.TOKEN_NOT_FOUND;
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
response.getWriter().write(objectMapper.writeValueAsString(ErrorRes.of(errorType.getStatus(), errorType.getMessage())));
}
}
Expand Down

0 comments on commit 31b595b

Please sign in to comment.