thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Geyer" <jensge...@hotmail.com>
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.
http://diwakergupta.github.io/thrift-missing-guide/thrift.pdf

Have fun,
JensG




-----Urspr√ľngliche Nachricht----- 
From: Julien Greard
Sent: Friday, July 24, 2015 2:02 PM
To: user@thrift.apache.org
Subject: error details

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