Methods

Thrift::ApplicationException

Attributes

type[R]

Public Class Methods

new(type=UNKNOWN, message=nil) click to toggle source
# File lib/thrift/exceptions.rb, line 43
def initialize(type=UNKNOWN, message=nil)
  super(message)
  @type = type
end

Public Instance Methods

read(iprot) click to toggle source
# File lib/thrift/exceptions.rb, line 48
def read(iprot)
  iprot.read_struct_begin
  while true
    fname, ftype, fid = iprot.read_field_begin
    if ftype == Types::STOP
      break
    end
    if fid == 1 and ftype == Types::STRING
      @message = iprot.read_string
    elsif fid == 2 and ftype == Types::I32
      @type = iprot.read_i32
    else
      iprot.skip(ftype)
    end
    iprot.read_field_end
  end
  iprot.read_struct_end
end
write(oprot) click to toggle source
# File lib/thrift/exceptions.rb, line 67
def write(oprot)
  oprot.write_struct_begin('Thrift::ApplicationException')
  unless @message.nil?
    oprot.write_field_begin('message', Types::STRING, 1)
    oprot.write_string(@message)
    oprot.write_field_end
  end
  unless @type.nil?
    oprot.write_field_begin('type', Types::I32, 2)
    oprot.write_i32(@type)
    oprot.write_field_end
  end
  oprot.write_field_stop
  oprot.write_struct_end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.