You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Zhihua Deng (Jira)" <ji...@apache.org> on 2025/06/16 23:43:00 UTC

[jira] [Comment Edited] (THRIFT-5875) ServerContext offers API to catch the thrift exception

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

Zhihua Deng edited comment on THRIFT-5875 at 6/16/25 11:42 PM:
---------------------------------------------------------------

I think TProtocolExceptions and TTransportExceptions are different in cpp and java and for different use cases. Though some of exception types might be confusing, they are for different purposes as I got from the codes. What do you think? cc [~jensg] 


was (Author: dengzh):
I think TProtocolExceptions and TTransportExceptions are different in cpp and java and for different use cases. Though some of exception types might be confusing, they are for different purposes as I got from the codes. What do you think? cc [~jensg] 

> ServerContext offers API to catch the thrift exception
> ------------------------------------------------------
>
>                 Key: THRIFT-5875
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5875
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Library
>            Reporter: Zhihua Deng
>            Assignee: Zhihua Deng
>            Priority: Major
>
> If we the exception thrown from transport lawyer, such as the
> MESSAGE_SIZE_LIMIT or CORRUPTED_DATA, in order not to pollute the byte stream, the server will kill the transport, on the client side it would receive the message indicating the socket is killed by peer. It's would be nice if we can send the exception back to the client to tell what's happening on the server side, the TServerEventHandler deleteContext provides a way for such purpose if we can get the exception from the ServerContext. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)