Skip to content

Commit

Permalink
[Fix]: restAdvice 에러 방지 (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
bayy1216 committed Aug 12, 2024
1 parent 1037419 commit a4c54c8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ public ApiResponse<Void> onException(
@AuthenticationPrincipal JwtUser jwtUser
) {
String eventId = MDC.get(CommonHttpRequestInterceptor.HEADER_REQUEST_UUID_KEY);
log.error("eventId = {}, userId = {} ", eventId, jwtUser.getId(), e);
String userId = jwtUser == null ? "anonymous" : jwtUser.getId().toString();
log.error("eventId = {}, userId = {} ", eventId, userId, e);
String message = ErrorCode.COMMON_SYSTEM_ERROR.getMessage() + "(eventId: " + eventId + ")";
return ApiResponse.fail(ErrorCode.COMMON_SYSTEM_ERROR.name(), message);
}
Expand Down

0 comments on commit a4c54c8

Please sign in to comment.