Class: Thrift::ApplicationException

### Home Classes Methods

### In Files

- lib/thrift/exceptions.rb

### Parent

Thrift::Exception

### Methods

- ::new
- #read
- #write

### Files

- CHANGELOG
- README
- Makefile

### Class/Module Index

Quicksearch

- Thrift
- Thrift::ApplicationException
- Thrift::BaseProtocol
- Thrift::BaseProtocolFactory
- Thrift::BaseServer
- Thrift::BaseServerTransport
- Thrift::BaseTransport
- Thrift::BaseTransportFactory
- Thrift::BinaryProtocol
- Thrift::BinaryProtocolAcceleratedFactory
- Thrift::BinaryProtocolFactory
- Thrift::BufferedTransport
- Thrift::BufferedTransportFactory
- Thrift::Client
- Thrift::CompactProtocol
- Thrift::CompactProtocol::CompactTypes
- Thrift::CompactProtocolFactory
- Thrift::Deserializer
- Thrift::Exception
- Thrift::FramedTransport
- Thrift::FramedTransportFactory
- Thrift::HTTPClientTransport
- Thrift::IOStreamTransport
- Thrift::MemoryBufferTransport
- Thrift::MessageTypes
- Thrift::MongrelHTTPServer
- Thrift::MongrelHTTPServer::Handler
- Thrift::NonblockingServer
- Thrift::Processor
- Thrift::ProtocolException
- Thrift::Serializer
- Thrift::ServerSocket
- Thrift::SimpleServer
- Thrift::Socket
- Thrift::Struct
- Thrift::Struct_Union
- Thrift::ThreadPoolServer
- Thrift::ThreadedServer
- Thrift::TransportException
- Thrift::TransportUtils
- Thrift::TypeError
- Thrift::Types
- Thrift::UNIXServerSocket
- Thrift::UNIXSocket
- Thrift::Union
- Fixnum

No matching classes.

# 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

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