Open abhinav opened 8 years ago
Proposal: We call it InternalApplicationError
or something similar that is more obvious than TApplicationException
. It is simple enough to make message.dumps
and message.loads
support it. (Right now, message.loads
treats this as an unknown exception and raises an exception with the Value-level representation).
import thriftrw
from thriftrw.something import InternalApplicationError # something or just top-level TBD
myservice = thriftrw.load(..)
payload = myservice.dumps.message(InternalApplicationError(..), seqid=42)
message = myservice.loads.message(myservice.SomeService, payload)
assert message.message_type == mtype.EXCEPTION
raise message.body
The Client/Server API in #103 will need to support this too.
Actually, the EXCEPTION message still needs the method name.
We need a way to handle uncaught exceptions. Thrift uses the following shape for internal exceptions.
We need to be able to send messages with that as the payload and
EXCEPTION
as the message type.