thriftrw / thriftrw-node

A thrift binary encoding library using bufrw
MIT License
57 stars 25 forks source link

EXCEPTION message type for Thrift envelopes #117

Open abhinav opened 8 years ago

abhinav commented 8 years ago

In Apache Thrift, when the message type for the Thrift envelope is exception, the payload is a TApplicationException, which is defined as:

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
}

Depends on: #107 Related Python issue: thriftrw/thriftrw-python#104.