rsanchez
2015-01-30 71ddf7a4e293ff26e078edfd834adb7537b396ca
securis/src/main/java/net/curisit/securis/DefaultExceptionHandler.java
....@@ -40,13 +40,13 @@
4040 public Response toResponse(Exception e) {
4141 releaseEntityManager();
4242 if (e instanceof ForbiddenException) {
43
- LOG.warn("Unauthorized access to {}, user: {}", request.getPathInfo(), bsc.getUserPrincipal());
43
+ LOG.warn("ForbiddenException: {}", e);
4444 return Response.status(Status.UNAUTHORIZED).header(ERROR_CODE_MESSAGE_HEADER, ErrorCodes.INVALID_CREDENTIALS)
4545 .header(ERROR_MESSAGE_HEADER, "Unathorized access to the application").type(MediaType.APPLICATION_JSON).build();
4646 }
4747
4848 if (e instanceof SeCurisServiceException) {
49
- LOG.warn("SeCurisServiceException accessing to {}, user: {}", request.getPathInfo(), bsc.getUserPrincipal());
49
+ LOG.warn("SeCurisServiceException: {}", e);
5050 return Response.status(DEFAULT_APP_ERROR_STATUS_CODE).header(ERROR_CODE_MESSAGE_HEADER, ((SeCurisServiceException) e).getStatus())
5151 .header(ERROR_MESSAGE_HEADER, e.getMessage()).type(MediaType.APPLICATION_JSON).build();
5252 }