You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2017/09/14 21:12:10 UTC

incubator-juneau git commit: ExecTime not set when error occurs during REST call.

Repository: incubator-juneau
Updated Branches:
  refs/heads/master b578a7c73 -> 426cd0f07


ExecTime not set when error occurs during REST call.

Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/426cd0f0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/426cd0f0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/426cd0f0

Branch: refs/heads/master
Commit: 426cd0f07fcacd7e406ddc31ea2f499826df94e9
Parents: b578a7c
Author: JamesBognar <ja...@apache.org>
Authored: Thu Sep 14 17:12:08 2017 -0400
Committer: JamesBognar <ja...@apache.org>
Committed: Thu Sep 14 17:12:08 2017 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/juneau/rest/RestCallHandler.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/426cd0f0/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCallHandler.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCallHandler.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCallHandler.java
index 088d09f..21e025e 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCallHandler.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCallHandler.java
@@ -184,12 +184,14 @@ public class RestCallHandler {
 			r1.setAttribute("ExecTime", System.currentTimeMillis() - startTime);
 
 		} catch (RestException e) {
-			handleError(r1, r2, e);
 			r1.setAttribute("Exception", e);
+			r1.setAttribute("ExecTime", System.currentTimeMillis() - startTime);
+			handleError(r1, r2, e);
 		} catch (Throwable e) {
 			RestException e2 = new RestException(SC_INTERNAL_SERVER_ERROR, e);
-			handleError(r1, r2, e2);
 			r1.setAttribute("Exception", e);
+			r1.setAttribute("ExecTime", System.currentTimeMillis() - startTime);
+			handleError(r1, r2, e2);
 		}
 
 		context.finishCall(r1, r2);