You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2008/12/18 01:52:44 UTC

[jira] Commented: (THRIFT-237) Update Exception class generation to TException decendent

    [ https://issues.apache.org/jira/browse/THRIFT-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657640#action_12657640 ] 

Bryan Duxbury commented on THRIFT-237:
--------------------------------------

Maybe every Thrift file should have a default exception base class, and then all the exceptions defined in that file derive from that? I'm a little worried that deriving everything from TException sort of muddles what you're getting. I see a TException as a problem from the library, not user code.

> Update Exception class generation to TException decendent
> ---------------------------------------------------------
>
>                 Key: THRIFT-237
>                 URL: https://issues.apache.org/jira/browse/THRIFT-237
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (C#), Compiler (Cocoa), Compiler (Java), Compiler (Python)
>         Environment: Java
>            Reporter: Martin Smith
>            Priority: Trivial
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.