Class: Tama::Error::HTTPError

Inherits:
Error
  • Object
show all
Defined in:
lib/tama/error.rb

Direct Known Subclasses

NotFoundError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status:, body: nil) ⇒ HTTPError

Returns a new instance of HTTPError.



21
22
23
24
25
# File 'lib/tama/error.rb', line 21

def initialize(message = nil, status:, body: nil)
  @status = status
  @body = body
  super(message || "HTTP request failed with status #{status}")
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



19
20
21
# File 'lib/tama/error.rb', line 19

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



19
20
21
# File 'lib/tama/error.rb', line 19

def status
  @status
end