thrift icon indicating copy to clipboard operation
thrift copied to clipboard

THRIFT-1911: TransportException should be raised when Socket is not open instead of IOError

Open kpumuk opened this issue 1 month ago • 0 comments

In Thrift::Socket#write at line 63, an IOError is raised if the socket is not open.

However this raise is outside of the being/rescue block of the method, so this IOError propagates up instead of Thrift::TransportException. There is a rescue class that rescues StandardError and wraps in a TransportException, but is is not applied to this first line of the method.

This MR switches the error from IOError to Thrift::TransportException with NOT_OPEN code.

  • [x] Did you create an Apache Jira ticket? THRIFT-1911
  • [x] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • [x] Did you squash your changes to a single commit? (not required, but preferred)
  • [x] Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • [ ] If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

kpumuk avatar Dec 05 '25 00:12 kpumuk