Commit 738481d 1 parent bf13883 commit 738481d Copy full SHA for 738481d
File tree 1 file changed +7
-2
lines changed
src/main/java/com/sponus/sponusbe/global/common/exception
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 22
22
public class GlobalExceptionHandler {
23
23
24
24
@ ExceptionHandler ({Exception .class })
25
- public ResponseEntity <ApiResponse <Void >> handleAllException (Exception e ) {
25
+ public ResponseEntity <ApiResponse <String >> handleAllException (Exception e ) {
26
26
log .error (">>>>> Internal Server Error : " , e );
27
27
BaseErrorCode errorCode = GlobalErrorCode .INTERNAL_SERVER_ERROR ;
28
- return ResponseEntity .internalServerError ().body (errorCode .getErrorResponse ());
28
+ ApiResponse <String > errorResponse = ApiResponse .onFailure (
29
+ errorCode .getCode (),
30
+ errorCode .getMessage (),
31
+ e .getMessage ()
32
+ );
33
+ return ResponseEntity .internalServerError ().body (errorResponse );
29
34
}
30
35
31
36
@ ExceptionHandler ({CustomException .class })
You can’t perform that action at this time.
0 commit comments