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

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
46 def initialize(type=UNKNOWN, message=nil)
47   super(message)
48   @type = type
49 end

Public Instance Methods

read(iprot) click to toggle source
   # File lib/thrift/exceptions.rb
51 def read(iprot)
52   iprot.read_struct_begin
53   while true
54     fname, ftype, fid = iprot.read_field_begin
55     if ftype == Types::STOP
56       break
57     end
58     if fid == 1 and ftype == Types::STRING
59       @message = iprot.read_string
60     elsif fid == 2 and ftype == Types::I32
61       @type = iprot.read_i32
62     else
63       iprot.skip(ftype)
64     end
65     iprot.read_field_end
66   end
67   iprot.read_struct_end
68 end
write(oprot) click to toggle source
   # File lib/thrift/exceptions.rb
70 def write(oprot)
71   oprot.write_struct_begin('Thrift::ApplicationException')
72   unless @message.nil?
73     oprot.write_field_begin('message', Types::STRING, 1)
74     oprot.write_string(@message)
75     oprot.write_field_end
76   end
77   unless @type.nil?
78     oprot.write_field_begin('type', Types::I32, 2)
79     oprot.write_i32(@type)
80     oprot.write_field_end
81   end
82   oprot.write_field_stop
83   oprot.write_struct_end
84 end