Exception: Nimbu::Error::NimbuError

Inherits:
StandardError
  • Object
show all
Extended by:
Utils::Descendants
Defined in:
lib/nimbu-api/errors.rb

Direct Known Subclasses

ClientError, ServiceError

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::Descendants

descendants

Constructor Details

#initialize(message = $!) ⇒ NimbuError

Initialize a new Nimbu error object.



12
13
14
15
16
17
18
19
# File 'lib/nimbu-api/errors.rb', line 12

def initialize(message=$!)
  if message.respond_to?(:backtrace)
    super(message.message)
    @response_message = message
  else
    super(message.to_s)
  end
end

Instance Attribute Details

#response_headersObject (readonly)

Returns the value of attribute response_headers.



8
9
10
# File 'lib/nimbu-api/errors.rb', line 8

def response_headers
  @response_headers
end

#response_messageObject (readonly)

Returns the value of attribute response_message.



8
9
10
# File 'lib/nimbu-api/errors.rb', line 8

def response_message
  @response_message
end

Instance Method Details

#backtraceObject



21
22
23
# File 'lib/nimbu-api/errors.rb', line 21

def backtrace
  @response_message ? @response_message.backtrace : super
end