Exception: BERTRPC::BERTRPCError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/bertrpc/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, klass = nil, bt = []) ⇒ BERTRPCError

Returns a new instance of BERTRPCError.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/bertrpc/errors.rb', line 5

def initialize(msg = nil, klass = nil, bt = [])
  case msg
    when Array
      code, message = msg
    else
      code, message = [0, msg]
  end

  if klass
    self.original_exception = RemoteError.new("#{klass}: #{message}")
    self.original_exception.set_backtrace(bt)
  else
    self.original_exception = self
  end

  self.code = code
  super(message)
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



3
4
5
# File 'lib/bertrpc/errors.rb', line 3

def code
  @code
end

#original_exceptionObject

Returns the value of attribute original_exception.



3
4
5
# File 'lib/bertrpc/errors.rb', line 3

def original_exception
  @original_exception
end