Revision 56661
Added by Ioannis Diplas over 4 years ago
GenericControllerAdvice.java | ||
---|---|---|
29 | 29 |
@ResponseStatus(HttpStatus.NOT_FOUND) |
30 | 30 |
@ExceptionHandler(ResourceNotFoundException.class) |
31 | 31 |
@ResponseBody |
32 |
ServerError securityException(HttpServletRequest req, Exception ex) { |
|
32 |
public ServerError securityException(HttpServletRequest req, Exception ex) {
|
|
33 | 33 |
return new ServerError(req.getRequestURL().toString(),ex); |
34 | 34 |
} |
35 | 35 |
|
36 | 36 |
@ResponseStatus(HttpStatus.FORBIDDEN) |
37 | 37 |
@ExceptionHandler(AccessDeniedException.class) |
38 | 38 |
@ResponseBody |
39 |
ServerError accessDeniedException(HttpServletRequest req, Exception ex) { |
|
39 |
public ServerError accessDeniedException(HttpServletRequest req, Exception ex) {
|
|
40 | 40 |
return new ServerError(req.getRequestURL().toString(),ex); |
41 | 41 |
} |
42 | 42 |
|
43 | 43 |
@ResponseStatus(HttpStatus.NOT_FOUND) |
44 | 44 |
@ExceptionHandler(UnknownHostException.class) |
45 | 45 |
@ResponseBody |
46 |
ServerError unknownHostException(HttpServletRequest req, Exception ex) { |
|
46 |
public ServerError unknownHostException(HttpServletRequest req, Exception ex) {
|
|
47 | 47 |
return new ServerError(req.getRequestURL().toString(),ex); |
48 | 48 |
} |
49 | 49 |
|
50 | 50 |
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) |
51 | 51 |
@ExceptionHandler({JSONException.class,BrokerException.class,ValidatorServiceException.class}) |
52 | 52 |
@ResponseBody |
53 |
ServerError internalException(HttpServletRequest req, Exception ex) { |
|
53 |
public ServerError internalException(HttpServletRequest req, Exception ex) {
|
|
54 | 54 |
return new ServerError(req.getRequestURL().toString(),ex); |
55 | 55 |
} |
56 | 56 |
|
57 | 57 |
@ResponseStatus(HttpStatus.GATEWAY_TIMEOUT) |
58 | 58 |
@ExceptionHandler(EndPointException.class) |
59 | 59 |
@ResponseBody |
60 |
ServerError endPointException(HttpServletRequest req, Exception ex) { |
|
60 |
public ServerError endPointException(HttpServletRequest req, Exception ex) {
|
|
61 | 61 |
return new ServerError(req.getRequestURL().toString(),ex); |
62 | 62 |
} |
63 | 63 |
|
64 |
|
|
65 | 64 |
} |
Also available in: Unified diff
- Fixing some code-smells
- Implemented search of piwik repos
- Added site_id info on repository