From 4c93a72072f6e434a75652cd276c8537a884ad81 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 26 Aug 2012 17:12:25 -0300 Subject: [PATCH] Do no report errors on security exceptions. --- .../main/java/com/wisemapping/rest/BaseController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java b/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java index 9e7700b4..464b3b0d 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java @@ -63,10 +63,16 @@ public class BaseController { return new RestErrors(ex.getErrors(), messageSource); } - @ExceptionHandler(com.wisemapping.exceptions.AccessDeniedSecurityException.class) + @ExceptionHandler(java.lang.reflect.UndeclaredThrowableException.class) @ResponseStatus(HttpStatus.BAD_REQUEST) public RestErrors handleSecurityErrors(@NotNull ValidationException ex) { return new RestErrors(ex.getErrors(), messageSource); } + @ExceptionHandler(com.wisemapping.exceptions.AccessDeniedSecurityException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public RestErrors handleSecurity2Errors(@NotNull ValidationException ex) { + return new RestErrors(ex.getErrors(), messageSource); + } + }