Exception: Namira::Errors::HTTPError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/namira/errors/http_error.rb

Overview

HTTP Error

Any non 2xx status code will raise this error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, status, response) ⇒ HTTPError

Returns a new instance of HTTPError

Parameters:

  • msg (String)

    The error message. e.g. “http_error/500”

  • status (Integer)

    The HTTP status that caused the error

  • response (Namira::Response)

    The HTTP response



22
23
24
25
26
# File 'lib/namira/errors/http_error.rb', line 22

def initialize(msg, status, response)
  @status = status
  @response = response
  super(msg)
end

Instance Attribute Details

#responseNamira::Response (readonly)

Returns The HTTP response.

Returns:



14
15
16
# File 'lib/namira/errors/http_error.rb', line 14

def response
  @response
end

#statusInteger (readonly)

Returns The HTTP status that caused the error.

Returns:

  • (Integer)

    The HTTP status that caused the error



10
11
12
# File 'lib/namira/errors/http_error.rb', line 10

def status
  @status
end