| .. | .. |
|---|
| 40 | 40 | public Response toResponse(Exception e) { |
|---|
| 41 | 41 | releaseEntityManager(); |
|---|
| 42 | 42 | if (e instanceof ForbiddenException) { |
|---|
| 43 | | - LOG.warn("Unauthorized access to {}, user: {}", request.getPathInfo(), bsc.getUserPrincipal()); |
|---|
| 43 | + LOG.warn("ForbiddenException: {}", e); |
|---|
| 44 | 44 | return Response.status(Status.UNAUTHORIZED).header(ERROR_CODE_MESSAGE_HEADER, ErrorCodes.INVALID_CREDENTIALS) |
|---|
| 45 | 45 | .header(ERROR_MESSAGE_HEADER, "Unathorized access to the application").type(MediaType.APPLICATION_JSON).build(); |
|---|
| 46 | 46 | } |
|---|
| 47 | 47 | |
|---|
| 48 | 48 | if (e instanceof SeCurisServiceException) { |
|---|
| 49 | | - LOG.warn("SeCurisServiceException accessing to {}, user: {}", request.getPathInfo(), bsc.getUserPrincipal()); |
|---|
| 49 | + LOG.warn("SeCurisServiceException: {}", e); |
|---|
| 50 | 50 | return Response.status(DEFAULT_APP_ERROR_STATUS_CODE).header(ERROR_CODE_MESSAGE_HEADER, ((SeCurisServiceException) e).getStatus()) |
|---|
| 51 | 51 | .header(ERROR_MESSAGE_HEADER, e.getMessage()).type(MediaType.APPLICATION_JSON).build(); |
|---|
| 52 | 52 | } |
|---|