You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/09/07 09:34:53 UTC
[5/5] git commit: Log the error at the back-end without hiding.
Log the error at the back-end without hiding.
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/0b63c359
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/0b63c359
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/0b63c359
Branch: refs/heads/master
Commit: 0b63c359b64e91ca3c9b038effa58d1cce50912c
Parents: 491fdb7
Author: Nirmal Fernando <ni...@gmail.com>
Authored: Sun Sep 7 13:04:07 2014 +0530
Committer: Nirmal Fernando <ni...@gmail.com>
Committed: Sun Sep 7 13:04:07 2014 +0530
----------------------------------------------------------------------
.../stratos/rest/endpoint/handlers/CustomExceptionMapper.java | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/0b63c359/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/handlers/CustomExceptionMapper.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/handlers/CustomExceptionMapper.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/handlers/CustomExceptionMapper.java
index 1a8d374..bc6941d 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/handlers/CustomExceptionMapper.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/handlers/CustomExceptionMapper.java
@@ -44,6 +44,8 @@ public class CustomExceptionMapper implements ExceptionMapper<RestAPIException>
// if no specific error specified we are throwing the bad request http status code by default
Response.Status httpStatus= (restAPIException.getHTTPStatusCode() != null)?
restAPIException.getHTTPStatusCode():Response.Status.BAD_REQUEST;
+
+ log.error(errorMessage, restAPIException);
return Response.status(httpStatus.getStatusCode()).type(MediaType.APPLICATION_JSON).
entity(Utils.buildMessage(httpStatus.getStatusCode(),errorMessage)).build();
}