Exception: TeamworkApi::Error

Inherits:
TeamworkError show all
Defined in:
lib/teamwork_api/error.rb

Instance Attribute Summary collapse

Attributes inherited from TeamworkError

#response

Instance Method Summary collapse

Constructor Details

#initialize(exception = $!) ⇒ TeamworkApi::Error

Initializes a new Error object

Parameters:

  • exception (Exception, String) (defaults to: $!)


18
19
20
21
22
23
24
25
# File 'lib/teamwork_api/error.rb', line 18

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

Instance Attribute Details

#wrapped_exceptionObject (readonly)

Returns the value of attribute wrapped_exception.



12
13
14
# File 'lib/teamwork_api/error.rb', line 12

def wrapped_exception
  @wrapped_exception
end