THRIFT-1419. java: AbstractNonBlockingServer does not catch errors when invoking the processor
This patch changes the invoke() method to catch Throwables instead of just Exceptions.
Patch: Thomas Kielbus"
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1196848 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/java/src/org/apache/thrift/server/AbstractNonblockingServer.java b/lib/java/src/org/apache/thrift/server/AbstractNonblockingServer.java
index 2bd74fa..65d8738 100644
--- a/lib/java/src/org/apache/thrift/server/AbstractNonblockingServer.java
+++ b/lib/java/src/org/apache/thrift/server/AbstractNonblockingServer.java
@@ -479,10 +479,10 @@
return;
} catch (TException te) {
LOGGER.warn("Exception while invoking!", te);
- } catch (Exception e) {
- LOGGER.error("Unexpected exception while invoking!", e);
+ } catch (Throwable t) {
+ LOGGER.error("Unexpected throwable while invoking!", t);
}
- // This will only be reached when there is an exception.
+ // This will only be reached when there is a throwable.
state_ = FrameBufferState.AWAITING_CLOSE;
requestSelectInterestChange();
}