Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Cannot Reproduce
-
None
-
None
-
Java
Description
Make all generated Exception objects derived classes of TExceptions instead of Exceptions. This allows callers to handle all errors of their service by catching TException, eliminating the need for multiple catch blocks where not required by the client code.
This follows the more recent patterns set for C++, PHP, Perl.
The languages affects are
Java, python, Cocoa, csharp
This could negatively affect code where the base exception class TException is handled prior to the generated exception classes.
e.g.
try {
} catch (TException te) {
} catch (ThriftAppException tae) {
}
Patch available for Java, can build patches for python, cocoa and csharp at the same time.
Attachments
Issue Links
- is related to
-
THRIFT-5333 Exceptions defined in IDL to extend Exception rather than TException
- Resolved
- relates to
-
THRIFT-724 User defined exceptions shouldn't derive from TException
- Closed
-
THRIFT-1761 Make generated exceptions have a common unique parent
- Closed