Exception: Jahuty::Exception::Error

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

Overview

Thrown when a client- or server-error occurs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(problem) ⇒ Error

Returns a new instance of Error.



9
10
11
12
13
# File 'lib/jahuty/exception/error.rb', line 9

def initialize(problem)
  @problem = problem

  super
end

Instance Attribute Details

#problemObject (readonly)

Returns the value of attribute problem.



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

def problem
  @problem
end

Instance Method Details

#messageObject



15
16
17
# File 'lib/jahuty/exception/error.rb', line 15

def message
  "The API responded with #{@problem.status}, #{@problem.type}: #{@problem.detail}"
end