thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Geyer" <>
Subject Re: error details
Date Fri, 24 Jul 2015 20:00:11 GMT
Not really.

What puzzles me: How do you send these data? Normally the client (or the 
server with the response) should already complain about missing required 
data while serializing. The only scenario that comes to my mind is when 
adding "required" features to some existing data structures of a service and 
running old clients against a new server (or vice versa). That is something 
that should be avoided, for the very same reason you experience.

Diwaker put it quite good in his "missing guide": Required is forever.

Have fun,

-----Urspr√ľngliche Nachricht----- 
From: Julien Greard
Sent: Friday, July 24, 2015 2:02 PM
Subject: error details


Is there a way to have a nice error message while calling wrongly a
service in thrift ?

For example, when I have objects without "required" attributes, I get
the error below:

File "/home/user/something/my_service", line 129, in recv_my_service
     (fname, mtype, rseqid) = self._iprot.readMessageBegin()
line 130, in readMessageBegin
     sz = self.readI32()
line 210, in readI32
     buff = self.trans.readAll(4)
"/usr/lib/python2.7/site-packages/thrift/transport/", line
58, in readAll
     chunk = - have)
"/home/lib/python2.7/site-packages/thrift/transport/", line
159, in read
     self.__rbuf = StringIO(, self.__rbuf_size)))
"/usr/lib/python2.7/site-packages/thrift/transport/", line
159, in read
     self.__rbuf = StringIO(, self.__rbuf_size)))
   File "/usr/lib/python2.7/site-packages/thrift/transport/",
line 118, in read
     message='TSocket read 0 bytes')
TTransportException: TSocket read 0 bytes

In my example, I have a C++ ThriftServer and a Python Client.

I'd like to have an explicit message (like: "missing object attribute :
"). Is there an option to enable such message?


Julien Greard
Software Engineer

View raw message