GitHub user ctubbsii opened a pull request:
https://github.com/apache/thrift/pull/1186
THRIFT-1805 Provide option for handling RTEs
Adds a Java option to the generator to generate code which lets Thrift
handle RuntimeExceptions from a service, and present them as
TApplicationException to the client.
This addresses a back-and-forth debate over the expected behavior of
this in Java services, and the resulting breakage, as described in
THRIFT-1805 and related issues, by making the behavior configurable.
Throwable types are not handled, because it is generally ill-advised to
handle Error types within a Java application. So, this only allows
configuration of handling RuntimeException.
This patch preserves current behavior as the default, and works with
previously generated code.
This patch does not affect AsyncProcessFunction exception handling.
Related JIRAs: THRIFT-378, THRIFT-1658, THRIFT-1805, THRIFT-3607
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ctubbsii/thrift handle-runtimeexceptions
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/1186.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 #1186
----
commit 48ee27b210edf2d92af2f5060820d77ca0898aff
Author: Christopher Tubbs <[email protected]>
Date: 2017-02-10T03:32:00Z
THRIFT-1805 Provide option for handling RTEs
Adds a Java option to the generator to generate code which lets Thrift
handle RuntimeExceptions from a service, and present them as
TApplicationException to the client.
This addresses a back-and-forth debate over the expected behavior of
this in Java services, and the resulting breakage, as described in
THRIFT-1805 and related issues, by making the behavior configurable.
Throwable types are not handled, because it is generally ill-advised to
handle Error types within a Java application. So, this only allows
configuration of handling RuntimeException.
This patch preserves current behavior as the default, and works with
previously generated code.
This patch does not affect AsyncProcessFunction exception handling.
Related JIRAs: THRIFT-378, THRIFT-1658, THRIFT-1805, THRIFT-3607
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---