You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by james anderson <ja...@setf.de> on 2010/07/05 13:58:55 UTC

? background on exception encoding

good afternoon;


as i understand the code generated to send and receive messages,  
exceptions are handled in two distinct ways
- "protocol" exceptions appear as responses with a distinguished  
'exception' message type
- "application" exceptions appear in a 'response' message as a field  
of the "pseudo-struct" which otherwise serves to encode the single- 
valued result in its "success" field.

the generated message request/response code reads as if there is a  
lot of method specific code to emit and recognize these exceptions.
does this protocol offer some particular advantage?


Re: ? background on exception encoding

Posted by David Reiss <dr...@facebook.com>.
It allows you to include arbitrary structured data with exceptions.

james anderson wrote:
> good afternoon;
> 
> 
> as i understand the code generated to send and receive messages,
> exceptions are handled in two distinct ways
> - "protocol" exceptions appear as responses with a distinguished
> 'exception' message type
> - "application" exceptions appear in a 'response' message as a field of
> the "pseudo-struct" which otherwise serves to encode the single-valued
> result in its "success" field.
> 
> the generated message request/response code reads as if there is a lot
> of method specific code to emit and recognize these exceptions.
> does this protocol offer some particular advantage?
>