thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julien Greard <jgre...@e-vitech.com>
Subject error details
Date Fri, 24 Jul 2015 12:02:21 GMT
Hello,

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()
   File 
"/home/lib/python2.7/site-packages/thrift/protocol/TBinaryProtocol.py", 
line 130, in readMessageBegin
     sz = self.readI32()
   File 
"/usr/lib/python2.7/site-packages/thrift/protocol/TBinaryProtocol.py", 
line 210, in readI32
     buff = self.trans.readAll(4)
   File 
"/usr/lib/python2.7/site-packages/thrift/transport/TTransport.py", line 
58, in readAll
     chunk = self.read(sz - have)
   File 
"/home/lib/python2.7/site-packages/thrift/transport/TTransport.py", line 
159, in read
     self.__rbuf = StringIO(self.__trans.read(max(sz, self.__rbuf_size)))
   File 
"/usr/lib/python2.7/site-packages/thrift/transport/TTransport.py", line 
159, in read
     self.__rbuf = StringIO(self.__trans.read(max(sz, self.__rbuf_size)))
   File "/usr/lib/python2.7/site-packages/thrift/transport/TSocket.py", 
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?

BR

-- 
Julien Greard
Software Engineer
Evitech


Mime
View raw message