Exception: Formi9::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Formi9::Error
- Defined in:
- lib/formi9/error.rb
Overview
Part1 API error Custom error class for rescuing from all formi9.com errors
Direct Known Subclasses
BadGateway, BadRequest, GatewayTimeout, InternalServerError, NotFound, ServiceUnavailable, Unauthorized
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(response) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
Constructor Details
#initialize(response) ⇒ Error
Returns a new instance of Error.
7 8 9 10 11 12 |
# File 'lib/formi9/error.rb', line 7 def initialize(response) super @response = response.dup @http_method = response.method.to_s @url = response.url end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/formi9/error.rb', line 5 def errors @errors end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
5 6 7 |
# File 'lib/formi9/error.rb', line 5 def http_method @http_method end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/formi9/error.rb', line 5 def url @url end |
Instance Method Details
#message ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/formi9/error.rb', line 14 def <<-HEREDOC URL: #{@response.url} method: #{@response.method} response status: #{@response.status} response body: #{@response.response.body} HEREDOC end |