class Thrift::ApplicationException
Constants
- BAD_SEQUENCE_ID
- INTERNAL_ERROR
- INVALID_MESSAGE_TYPE
- MISSING_RESULT
- PROTOCOL_ERROR
- UNKNOWN
- UNKNOWN_METHOD
- WRONG_METHOD_NAME
Attributes
type[R]
Public Class Methods
new(type=UNKNOWN, message=nil)
click to toggle source
Calls superclass method
Thrift::Exception::new
# File lib/thrift/exceptions.rb 43 def initialize(type=UNKNOWN, message=nil) 44 super(message) 45 @type = type 46 end
Public Instance Methods
read(iprot)
click to toggle source
# File lib/thrift/exceptions.rb 48 def read(iprot) 49 iprot.read_struct_begin 50 while true 51 fname, ftype, fid = iprot.read_field_begin 52 if ftype == Types::STOP 53 break 54 end 55 if fid == 1 and ftype == Types::STRING 56 @message = iprot.read_string 57 elsif fid == 2 and ftype == Types::I32 58 @type = iprot.read_i32 59 else 60 iprot.skip(ftype) 61 end 62 iprot.read_field_end 63 end 64 iprot.read_struct_end 65 end
write(oprot)
click to toggle source
# File lib/thrift/exceptions.rb 67 def write(oprot) 68 oprot.write_struct_begin('Thrift::ApplicationException') 69 unless @message.nil? 70 oprot.write_field_begin('message', Types::STRING, 1) 71 oprot.write_string(@message) 72 oprot.write_field_end 73 end 74 unless @type.nil? 75 oprot.write_field_begin('type', Types::I32, 2) 76 oprot.write_i32(@type) 77 oprot.write_field_end 78 end 79 oprot.write_field_stop 80 oprot.write_struct_end 81 end