Exception: Jess::HttpClient::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/jess/http_client/error.rb

Overview

Base class for exceptions raised by Jess::HttpClient. These exceptions hold a reference to the URI and HTTP method (e.g. “GET”, “POST”) that were being attempted when the error occurred.

Direct Known Subclasses

BadCredentials, ConnectionError, NotFound, ServerError

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code.



8
9
10
# File 'lib/jess/http_client/error.rb', line 8

def code
  @code
end

#http_methodObject

Returns the value of attribute http_method.



8
9
10
# File 'lib/jess/http_client/error.rb', line 8

def http_method
  @http_method
end

#responseObject

Returns the value of attribute response.



8
9
10
# File 'lib/jess/http_client/error.rb', line 8

def response
  @response
end

#uriObject

Returns the value of attribute uri.



8
9
10
# File 'lib/jess/http_client/error.rb', line 8

def uri
  @uri
end

Instance Method Details

#to_sObject



10
11
12
13
# File 'lib/jess/http_client/error.rb', line 10

def to_s
  message = [code, super].join(" ").strip
  "#{message} (during #{http_method.to_s.upcase} #{uri})"
end