class Thrift::ApplicationException
Constants
- BAD_SEQUENCE_ID
- INTERNAL_ERROR
- INVALID_MESSAGE_TYPE
- INVALID_PROTOCOL
- INVALID_TRANSFORM
- MISSING_RESULT
- PROTOCOL_ERROR
- UNKNOWN
- UNKNOWN_METHOD
- UNSUPPORTED_CLIENT_TYPE
- WRONG_METHOD_NAME
Attributes
Public Class Methods
Source
# File lib/thrift/exceptions.rb 48 def initialize(type = UNKNOWN, message = nil) 49 super(message) 50 @type = type 51 end
Calls superclass method
Thrift::Exception::new
Public Instance Methods
Source
# File lib/thrift/exceptions.rb 53 def read(iprot, remaining_depth = DEFAULT_RECURSION_DEPTH) 54 raise ProtocolException.new(ProtocolException::DEPTH_LIMIT, "Maximum recursion depth exceeded") if remaining_depth <= 0 55 iprot.read_struct_begin 56 while true 57 _, ftype, fid = iprot.read_field_begin 58 if ftype == Types::STOP 59 break 60 end 61 if fid == 1 and ftype == Types::STRING 62 @message = iprot.read_string 63 elsif fid == 2 and ftype == Types::I32 64 @type = iprot.read_i32 65 else 66 iprot.skip(ftype) 67 end 68 iprot.read_field_end 69 end 70 iprot.read_struct_end 71 end
Source
# File lib/thrift/exceptions.rb 73 def write(oprot, remaining_depth = DEFAULT_RECURSION_DEPTH) 74 raise ProtocolException.new(ProtocolException::DEPTH_LIMIT, "Maximum recursion depth exceeded") if remaining_depth <= 0 75 oprot.write_struct_begin("Thrift::ApplicationException") 76 unless @message.nil? 77 oprot.write_field_begin("message", Types::STRING, 1) 78 oprot.write_string(@message) 79 oprot.write_field_end 80 end 81 unless @type.nil? 82 oprot.write_field_begin("type", Types::I32, 2) 83 oprot.write_i32(@type) 84 oprot.write_field_end 85 end 86 oprot.write_field_stop 87 oprot.write_struct_end 88 end