-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: security 모듈 CustomException 정의 및 ErrorCode 정리 #159
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
훨씬 깔끔해졌네요 감사합니다! 머지하겠습니다!
protected ResponseEntity<ErrorResponse> handleMemberCustomException(CustomException ex) { | ||
log.warn(">>>>> MemberCustomException : {}", ex); | ||
BaseErrorCode errorCode = ex.getErrorCode(); | ||
return ResponseEntity.status(errorCode.getStatus()).body(errorCode.getErrorResponse()); | ||
} | ||
|
||
@ExceptionHandler(SecurityCustomException.class) | ||
protected ResponseEntity<ErrorResponse> handleSecurityCustomException(SecurityCustomException ex) { | ||
log.warn(">>>>> SecurityCustomException : {}", ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 감사합니다!
public static void setErrorResponse(HttpServletResponse response, HttpStatus httpStatus) | ||
public static void setErrorResponse(HttpServletResponse response, HttpStatus httpStatus, Object body) | ||
throws IOException { | ||
String responseBody = objectMapper.writeValueAsString( | ||
new ErrorResponse(httpStatus.name(), httpStatus.getReasonPhrase())); | ||
response.setContentType(MediaType.APPLICATION_JSON_VALUE); | ||
response.setStatus(httpStatus.value()); | ||
response.setCharacterEncoding("UTF-8"); | ||
response.getWriter().write(responseBody); | ||
objectMapper.writeValue(response.getOutputStream(), body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정해주셔서 감사합니다!🙇♀️
* refactor: ErrorCode 정리 * refactor: HttpResponseUtil 적용 * refactor: SecurityCustomException 생성, 적용 * refactor: GlobalExceptionHandler 리팩터링 --------- Co-authored-by: Kim Dae Hwi <[email protected]>
* fix: api 이름 변경 * feat : 실시간 검색 기능 구현 - Aggregation 제외 * feat: #151 실시간 검색 document 추가, 쿼리 작성 * test: 멤버 도메인 test.http 파일 작성 (#149) * test: member 관련 http 테스트 추가 * test: 슈퍼관리자, 관리자 http 테스트 추가 --------- Co-authored-by: 조은비 <[email protected]> * refactor: 공통 BaseErrorCode 정의 (#153) Co-authored-by: 조은비 <[email protected]> * fix: CustomException의 필드를 BaseErrorCode로 변경 (#155) * fix: CustomException의 필드를 BaseErrorCode로 변경 * fix: BaseErrorCode 수정 * feat: 이탈된 예매에 대한 좌석 상태 변경 배치 (#157) * feat: 이탈된 예매에 대한 좌석 상태 변경 배치 * chore --------- Co-authored-by: byulcode <[email protected]> * docs: 예매 http 작성 (#161) * docs: http 유저 시나리오 작성 * fix: createBooking에서 세션 아이디 삭제하는 로직 비동기 메서드로 분리 * docs: http 작성 * refactor: security 모듈 CustomException 정의 및 ErrorCode 정리 (#159) * refactor: ErrorCode 정리 * refactor: HttpResponseUtil 적용 * refactor: SecurityCustomException 생성, 적용 * refactor: GlobalExceptionHandler 리팩터링 --------- Co-authored-by: Kim Dae Hwi <[email protected]> * feat: #151 aggregation 구현, source 포함 조건 추가 --------- Co-authored-by: Kim Dae Hwi <[email protected]> Co-authored-by: 조은비 <[email protected]> Co-authored-by: Hanna Lee <[email protected]> Co-authored-by: byulcode <[email protected]>
구현 기능
resolve: #156