Commit 9b63a38 1 parent 6159860 commit 9b63a38 Copy full SHA for 9b63a38
File tree 1 file changed +12
-0
lines changed
api/src/main/java/com/sponus/sponusbe/global/exception
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 14
14
import com .sponus .coredomain .domain .common .ApiResponse ;
15
15
import com .sponus .coredomain .domain .common .BaseErrorCode ;
16
16
import com .sponus .coredomain .domain .common .GlobalErrorCode ;
17
+ import com .sponus .coreinfrasecurity .jwt .exception .SecurityCustomException ;
17
18
import com .sponus .sponusbe .domain .organization .exception .OrganizationErrorCode ;
18
19
19
20
import lombok .extern .slf4j .Slf4j ;
@@ -34,6 +35,17 @@ public ResponseEntity<ApiResponse<String>> handleAllException(Exception e) {
34
35
return ResponseEntity .internalServerError ().body (errorResponse );
35
36
}
36
37
38
+ @ ExceptionHandler ({SecurityCustomException .class })
39
+ public ApiResponse <Object > handleSecurityCustomException (SecurityCustomException e ) {
40
+ log .warn (">>>>> SecurityCustomException occurred in servlet: {}" , e .getErrorCode ());
41
+ BaseErrorCode errorCode = e .getErrorCode ();
42
+ return ApiResponse .onFailure (
43
+ errorCode .getCode (),
44
+ errorCode .getMessage (),
45
+ e .getMessage ()
46
+ );
47
+ }
48
+
37
49
@ ExceptionHandler ({CustomException .class })
38
50
public ResponseEntity <ApiResponse <Void >> handleCustomException (CustomException e ) {
39
51
BaseErrorCode errorCode = e .getErrorCode ();
You can’t perform that action at this time.
0 commit comments