@@ -34,48 +34,48 @@ class ExceptionAdvice {
34
34
CorrelationSource correlationSource ;
35
35
36
36
@ ExceptionHandler (Exception .class )
37
- ResponseEntity <? > onUnexpectedError (Exception exception ) {
37
+ ResponseEntity <JsonBean > onUnexpectedError (Exception exception ) {
38
38
log .error ("Unexpected error" , exception );
39
39
return errorResponse (HttpStatus .INTERNAL_SERVER_ERROR , "INTERNAL_ERROR" );
40
40
}
41
41
42
42
@ ExceptionHandler (ServiceException .BadRequest .class )
43
- ResponseEntity <? > onBadRequest (ServiceException .BadRequest exception ) {
43
+ ResponseEntity <JsonBean > onBadRequest (ServiceException .BadRequest exception ) {
44
44
log .error ("Bad request" , exception );
45
45
return errorResponse (HttpStatus .BAD_REQUEST , exception .getCode ());
46
46
}
47
47
48
48
@ ExceptionHandler (ServiceException .Unauthorized .class )
49
- ResponseEntity <? > onUnauthorized (ServiceException .Unauthorized exception ) {
49
+ ResponseEntity <JsonBean > onUnauthorized (ServiceException .Unauthorized exception ) {
50
50
log .error ("Unauthorized" , exception );
51
51
return errorResponse (HttpStatus .UNAUTHORIZED , exception .getCode ());
52
52
}
53
53
54
54
@ ExceptionHandler (ServiceException .Forbidden .class )
55
- ResponseEntity <? > onForbidden (ServiceException .Forbidden exception ) {
55
+ ResponseEntity <JsonBean > onForbidden (ServiceException .Forbidden exception ) {
56
56
log .error ("Forbidden" , exception );
57
57
return errorResponse (HttpStatus .FORBIDDEN , exception .getCode ());
58
58
}
59
59
60
60
@ ExceptionHandler (ServiceException .NotFound .class )
61
- ResponseEntity <? > onNotFound (ServiceException .NotFound exception ) {
61
+ ResponseEntity <JsonBean > onNotFound (ServiceException .NotFound exception ) {
62
62
log .error ("Not found" , exception );
63
63
return errorResponse (HttpStatus .NOT_FOUND , exception .getCode ());
64
64
}
65
65
66
66
@ ExceptionHandler (ServiceException .InternalError .class )
67
- ResponseEntity <? > onInternalError (ServiceException .InternalError exception ) {
67
+ ResponseEntity <JsonBean > onInternalError (ServiceException .InternalError exception ) {
68
68
log .error ("Internal error" , exception );
69
69
return errorResponse (HttpStatus .INTERNAL_SERVER_ERROR , exception .getCode ());
70
70
}
71
71
72
72
@ ExceptionHandler (ServiceException .ServiceUnavailable .class )
73
- ResponseEntity <? > onServiceUnavailable (ServiceException .ServiceUnavailable exception ) {
73
+ ResponseEntity <JsonBean > onServiceUnavailable (ServiceException .ServiceUnavailable exception ) {
74
74
log .error ("Service unavailable" , exception );
75
75
return errorResponse (HttpStatus .SERVICE_UNAVAILABLE , exception .getCode ());
76
76
}
77
77
78
- private ResponseEntity <? > errorResponse (HttpStatus status , String code ) {
78
+ private ResponseEntity <JsonBean > errorResponse (HttpStatus status , String code ) {
79
79
return ResponseEntity .status (status )
80
80
.contentType (MediaType .APPLICATION_JSON )
81
81
.body (new JsonBean ()
0 commit comments