lib/cloud_party/exceptions.rb in cloud_party-0.1.5 vs lib/cloud_party/exceptions.rb in cloud_party-0.1.6
- old
+ new
@@ -15,29 +15,29 @@
@response = response
end
end
class UnknownError < RequestError
- def initialize(obj:, method:, response:, endpoint: nil, code:)
+ def initialize(message, method, endpoint, code, response)
super
end
- def self.error_string
+ def error_string
<<~HEREDOC
An error with the request has occurred, please make
sure the method verb, endpoint, and credentials are
correct for this request.
HEREDOC
end
- def self.extra_string
+ def extra_string
<<~HEREDOC
Credentials Context: #{@obj&.class&.cfg}
Method Verb: #{@method}
Endpoint: #{@endpoint}
HTTP Status Code: #{@code}
- Response Body: #{@response.body}
+ Response Body: #{@response&.body}
HEREDOC
end
end
autoload :UnRecognizedResultTypeError, 'cloud_party/exceptions/un_recognized_result_type_error'
autoload :UnRecognizedEndpointError, 'cloud_party/exceptions/un_recognized_endpoint_error'