Repository: qpid-broker-j Updated Branches: refs/heads/master b8981a7dd -> 4e6a665df
QPID-7719: Address review comments Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/4e6a665d Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/4e6a665d Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/4e6a665d Branch: refs/heads/master Commit: 4e6a665df59226b4b03c49f46b3632af8fd2c35e Parents: e1405a3 Author: Alex Rudyy <[email protected]> Authored: Mon Apr 24 15:21:30 2017 +0100 Committer: Alex Rudyy <[email protected]> Committed: Tue Apr 25 11:41:14 2017 +0100 ---------------------------------------------------------------------- .../plugin/filter/ExceptionHandlingFilter.java | 24 +++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/4e6a665d/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/filter/ExceptionHandlingFilter.java ---------------------------------------------------------------------- diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/filter/ExceptionHandlingFilter.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/filter/ExceptionHandlingFilter.java index d53cf06..2472cda 100644 --- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/filter/ExceptionHandlingFilter.java +++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/filter/ExceptionHandlingFilter.java @@ -60,19 +60,27 @@ public class ExceptionHandlingFilter implements Filter } catch (ServerScopedRuntimeException | Error e) { - if (_uncaughtExceptionHandler == null) + try { - LOGGER.error("Fatal system error", e); + if (e instanceof ServerScopedRuntimeException + && servletResponse instanceof HttpServletResponse + && !servletResponse.isCommitted()) + { + ((HttpServletResponse) servletResponse).sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } } - else + finally { - _uncaughtExceptionHandler.uncaughtException(Thread.currentThread(), e); + if (_uncaughtExceptionHandler == null) + { + LOGGER.error("Fatal system error", e); + } + else + { + _uncaughtExceptionHandler.uncaughtException(Thread.currentThread(), e); + } } - if (e instanceof ServerScopedRuntimeException) - { - sendError((ServerScopedRuntimeException)e, servletResponse, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); - } throw e; } catch (ExternalServiceTimeoutException e) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
