Exception: MonogotoApi::HTTPError

Inherits:
Error
  • Object
show all
Defined in:
lib/monogoto_api/errors.rb

Overview

Base class for HTTP errors (non-2xx responses)

Direct Known Subclasses

NotFoundError, ServerError, UnauthorizedError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ HTTPError

Returns a new instance of HTTPError.



14
15
16
17
# File 'lib/monogoto_api/errors.rb', line 14

def initialize(response)
    @response = response
    super("HTTP Request failed with status #{response.code}: #{response.body}")
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



12
13
14
# File 'lib/monogoto_api/errors.rb', line 12

def response
  @response
end