Do no report errors on security exceptions.

This commit is contained in:
Paulo Gustavo Veiga 2012-08-26 17:12:25 -03:00
parent 183f472f52
commit 4c93a72072

View File

@ -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);
}
}