qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1790567 - /qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/filter/ExceptionHandlingFilter.java
Date Fri, 07 Apr 2017 14:58:28 GMT
Author: orudyy
Date: Fri Apr  7 14:58:27 2017
New Revision: 1790567

URL: http://svn.apache.org/viewvc?rev=1790567&view=rev
Log:
QPID-7719: [Java Broker] Set response code to 500 when unexpected error occurs during REST
call

Modified:
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/filter/ExceptionHandlingFilter.java

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/filter/ExceptionHandlingFilter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/filter/ExceptionHandlingFilter.java?rev=1790567&r1=1790566&r2=1790567&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/filter/ExceptionHandlingFilter.java
(original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/filter/ExceptionHandlingFilter.java
Fri Apr  7 14:58:27 2017
@@ -62,9 +62,18 @@ public class ExceptionHandlingFilter imp
         {
             if (_uncaughtExceptionHandler == null)
             {
-                throw e;
+                LOGGER.error("Fatal system error", e);
             }
-            _uncaughtExceptionHandler.uncaughtException(Thread.currentThread(), e);
+            else
+            {
+                _uncaughtExceptionHandler.uncaughtException(Thread.currentThread(), e);
+            }
+
+            if (e instanceof  ServerScopedRuntimeException)
+            {
+                sendError((ServerScopedRuntimeException)e, servletResponse, HttpServletResponse.SC_GATEWAY_TIMEOUT);
+            }
+            throw e;
         }
         catch (ExternalServiceTimeoutException e)
         {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message