-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
일부 오류 및 코드 형태 깔끔하게 변경
- Loading branch information
Showing
4 changed files
with
11 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 4 additions & 7 deletions
11
src/main/java/umc/meme/auth/global/exception/ControllerAdvice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
package umc.meme.auth.global.exception; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
import umc.meme.auth.global.common.BaseResponseDto; | ||
import umc.meme.auth.global.common.status.ErrorStatus; | ||
import umc.meme.auth.global.exception.handler.AuthException; | ||
|
||
@RestControllerAdvice | ||
public class ControllerAdvice { | ||
|
||
@ExceptionHandler(value = AuthException.class) | ||
public ResponseEntity<?> invokeError(AuthException e) { | ||
System.out.println("=== AuthException.class ==="); | ||
System.out.println("HTTP_STATUS = " + e.getReason().getHttpStatus()); | ||
System.out.println("CODE = " + e.getReason().getCode()); | ||
System.out.println("REASON = " + e.getReason().getMessage()); | ||
return ResponseEntity.badRequest().build(); | ||
public BaseResponseDto<?> invokeError(AuthException e) { | ||
return BaseResponseDto.ErrorResponse((ErrorStatus) e.getBaseErrorCode()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters