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:



11
12
13
# File 'lib/tilia/http/client_http_exception.rb', line 11

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseResponseInterface (readonly)

Returns the full response object.

Returns:



25
26
27
# File 'lib/tilia/http/client_http_exception.rb', line 25

def response
  @response
end

Instance Method Details

#http_statusFixnum

The http status code for the error.

Returns:

  • (Fixnum)


18
19
20
# File 'lib/tilia/http/client_http_exception.rb', line 18

def http_status
  @response.status
end