Exception: Tilia::Http::ClientHttpException

Inherits:
HttpException
  • Object
show all
Defined in:
lib/tilia/http/client_http_exception.rb

Overview

This exception represents a HTTP error coming from the Client.

By default the Client will not emit these, this has to be explicitly enabled with the setThrowExceptions method.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ClientHttpException

Constructor

Parameters:

  • ResponseInterface

    response



20
21
22
# File 'lib/tilia/http/client_http_exception.rb', line 20

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseResponseInterface

Returns the full response object.

Returns:



13
14
15
# File 'lib/tilia/http/client_http_exception.rb', line 13

def response
  @response
end

Instance Method Details

#http_statusObject

The http status code for the error.

Returns:

  • int



27
28
29
# File 'lib/tilia/http/client_http_exception.rb', line 27

def http_status
  @response.status
end