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

Benjamin Gould commented on THRIFT-3830:
----------------------------------------

If I'm not mistaken, the TApplicationException is only transmitted by the Java 
library if the processor throws some exception that is not declared in IDL.  
Thus, the behavior in the pull request can easily be implemented without 
changes to the core library by declaring service methods to throw an exception 
with a string field that carries the stack trace.  You would then catch any 
unexpected exceptions, dump the stack trace to a string, and then populate and 
throw your declared exception.

In Java this should be relatively easy to achieve in a generic way by wrapping 
your service implementations in a JDK dynamic proxy to perform the above 
behavior.

IMO it is not a good idea to leak stack traces to the client by default.  And 
even though I think it would be a user friendly way to facilitate debugging if 
it was configurable option, it seems like a potential footgun when it comes to 
security.

> Add  detail exception message between server-side and  client-side
> ------------------------------------------------------------------
>
>                 Key: THRIFT-3830
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3830
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Library
>    Affects Versions: 0.9.3
>            Reporter: Dongchao Ding
>            Priority: Minor
>
> At present,when one TExcpetion occurs at server-side,  we just get one same 
> error tip like "Internal error processing ${invoke-method-name}", the detail 
> exception(exception message and exception stack) was gone.
> I think it's better to send detail  error info to client .



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to