Exception: Fanforce::Error::WebhookFailed
- Inherits:
-
Fanforce::Error
- Object
- StandardError
- Fanforce::Error
- Fanforce::Error::WebhookFailed
- Defined in:
- lib/fanforce/errors/errors.rb
Overview
Parameters were valid but request failed for another reason
Instance Attribute Summary collapse
-
#request_curl_command ⇒ Object
readonly
Returns the value of attribute request_curl_command.
-
#request_params ⇒ Object
readonly
Returns the value of attribute request_params.
-
#request_url ⇒ Object
readonly
Returns the value of attribute request_url.
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
-
#response_code ⇒ Object
readonly
Returns the value of attribute response_code.
Attributes inherited from Fanforce::Error
Instance Method Summary collapse
- #code ⇒ Object
- #default_error_code ⇒ Object
- #default_message ⇒ Object
-
#initialize(hash) ⇒ WebhookFailed
constructor
A new instance of WebhookFailed.
- #valid_error_codes ⇒ Object
Methods inherited from Fanforce::Error
#curl_command, #for, #format_error, #format_errors
Constructor Details
#initialize(hash) ⇒ WebhookFailed
Returns a new instance of WebhookFailed.
96 97 98 99 100 101 102 103 |
# File 'lib/fanforce/errors/errors.rb', line 96 def initialize(hash) @request_url = hash[:request_url] @request_params = hash[:request_params] @response_code = hash[:response_code] @response_body = hash[:response_body] @request_curl_command = "curl -X POST -d \"#{@request_params.to_param}\" #{@request_url}" super("Callback returned an HTTP response code of #{@response_code} when only 200 and 201 are allowed.") end |
Instance Attribute Details
#request_curl_command ⇒ Object (readonly)
Returns the value of attribute request_curl_command.
90 91 92 |
# File 'lib/fanforce/errors/errors.rb', line 90 def request_curl_command @request_curl_command end |
#request_params ⇒ Object (readonly)
Returns the value of attribute request_params.
90 91 92 |
# File 'lib/fanforce/errors/errors.rb', line 90 def request_params @request_params end |
#request_url ⇒ Object (readonly)
Returns the value of attribute request_url.
90 91 92 |
# File 'lib/fanforce/errors/errors.rb', line 90 def request_url @request_url end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
90 91 92 |
# File 'lib/fanforce/errors/errors.rb', line 90 def response_body @response_body end |
#response_code ⇒ Object (readonly)
Returns the value of attribute response_code.
90 91 92 |
# File 'lib/fanforce/errors/errors.rb', line 90 def response_code @response_code end |
Instance Method Details
#code ⇒ Object
91 |
# File 'lib/fanforce/errors/errors.rb', line 91 def code; 500 end |
#default_error_code ⇒ Object
94 |
# File 'lib/fanforce/errors/errors.rb', line 94 def default_error_code; :unknown end |
#default_message ⇒ Object
92 |
# File 'lib/fanforce/errors/errors.rb', line 92 def ; 'Webhook Failed' end |
#valid_error_codes ⇒ Object
93 |
# File 'lib/fanforce/errors/errors.rb', line 93 def valid_error_codes; [:third_party_error] end |