We need a way to handle uncaught exceptions. Thrift uses the following shape for internal exceptions. ``` enum ExceptionType { UNKNOWN = 0 UNKNOWN_METHOD = 1 INVALID_MESSAGE_TYPE = 2 WRONG_METHOD_NAME = 3 BAD_SEQUENCE_ID = 4 MISSING_RESULT = 5 INTERNAL_ERROR = 6 PROTOCOL_ERROR = 7 INVALID_TRANSFORM = 8 INVALID_PROTOCOL = 9 UNSUPPORTED_CLIENT_TYPE = 10 } struct TApplicationException { 1: optional string message 2: optional ExceptionType type } ``` We need to be able to send messages with that as the payload and `EXCEPTION` as the message type.
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
EXCEPTIONas the message type.