[ https://issues.apache.org/jira/browse/PROTON-881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14587006#comment-14587006 ]
ASF GitHub Bot commented on PROTON-881: --------------------------------------- GitHub user prestona opened a pull request: https://github.com/apache/qpid-proton/pull/37 PROTON-881: Graceful handling of runtime exceptions thrown within han… …dlers When a runtime (unchecked) exceptions is thrown within a handler, the reactor now catches it and rethrows it as a HandlerException (which is also an unchecked exception). The HandlerException references the handler that threw the original exception and also chains the original exception as its "cause". Note: this PR makes a (slight) change in behaviour to the Event.dispatch() method. Currently if an application throws an unchecked exception from within the dispatch() method, this exception will peculate up the stack until it is caught. With this PR: any unchecked exceptions thrown by a handler will be trapped inside the dispatch() method and re-thrown linked to a HandlerException. I /think/ that this is unlikely to break (m)any applications - as relying on exact runtime behaviour when throwing unchecked exceptions from callbacks is a rather risky thing to do... However: if this is a problem I can move the code for trapping unchecked exceptions out of the EventImpl class. The disadvantage to doing this is that it will no longer be possible to identify the specific handler that threw the exception. You can merge this pull request into a Git repository by running: $ git pull https://github.com/prestona/qpid-proton reactor Alternatively you can review and apply these changes as the patch at: https://github.com/apache/qpid-proton/pull/37.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #37 ---- commit f9f46900b606c103cc6be48e892370896cfbae1e Author: Adrian Preston <prest...@uk.ibm.com> Date: 2015-06-15T21:49:43Z PROTON-881: Graceful handling of runtime exceptions thrown within handlers When a runtime (unchecked) exception is thrown from within a handler, the reactor now catches it and rethrows it as a HandlerException (which is also an unchecked exception). The HandlerException references the handler that threw the original exception and also chains the original exception as its "cause". ---- > Proton-j reactor implementation > ------------------------------- > > Key: PROTON-881 > URL: https://issues.apache.org/jira/browse/PROTON-881 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-j > Affects Versions: 0.9 > Reporter: Adrian Preston > Priority: Minor > > To keep the proton-j codebase consistent with proton-c - there should be a > native Java port of the reactor. -- This message was sent by Atlassian JIRA (v6.3.4#6332)