Class Thrift::ApplicationException
In: lib/thrift/exceptions.rb
lib/thrift/exceptions.rb
Parent: Exception

Methods

new   new   read   read   write   write  

Constants

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
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

Attributes

type  [R] 
type  [R] 

Public Class methods

[Source]

    # File lib/thrift/exceptions.rb, line 43
43:     def initialize(type=UNKNOWN, message=nil)
44:       super(message)
45:       @type = type
46:     end

[Source]

    # File lib/thrift/exceptions.rb, line 43
43:     def initialize(type=UNKNOWN, message=nil)
44:       super(message)
45:       @type = type
46:     end

Public Instance methods

[Source]

    # File lib/thrift/exceptions.rb, line 48
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

[Source]

    # File lib/thrift/exceptions.rb, line 48
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

[Source]

    # File lib/thrift/exceptions.rb, line 67
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

[Source]

    # File lib/thrift/exceptions.rb, line 67
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

[Validate]