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-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org