Exception: TeamworkApi::Error

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

Overview

specific errors

Instance Attribute Summary collapse

Attributes inherited from TeamworkError

#response

Instance Method Summary collapse

Constructor Details

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

Initializes a new Error object

Parameters:

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


24
25
26
27
28
29
30
31
# File 'lib/teamwork_api/error.rb', line 24

def initialize(exception = $ERROR_INFO)
  @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.



18
19
20
# File 'lib/teamwork_api/error.rb', line 18

def wrapped_exception
  @wrapped_exception
end