Exception: DCMClient::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/dcm_client/error.rb

Overview

A parent error class makes it easier to trap any error from client code.

Direct Known Subclasses

NotFound, TimeoutError, UnprocessableEntity

Defined Under Namespace

Classes: NotFound, TimeoutError, UnprocessableEntity

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg, response = nil) ⇒ Error

Returns a new instance of Error.



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dcm_client/error.rb', line 9

def initialize(arg, response=nil)
  self.response = response
  if (arg.respond_to?(:backtrace))
    super(arg.message)
    self.set_backtrace(arg.backtrace)
    if (arg.respond_to?(:response))
      self.response = arg.response
    end
  else
    super(arg.to_s)
  end
end

Instance Attribute Details

#responseObject

Returns the value of attribute response.



7
8
9
# File 'lib/dcm_client/error.rb', line 7

def response
  @response
end