Exception: PaypalClient::Errors::Error
- Inherits:
-
StandardError
- Object
- StandardError
- PaypalClient::Errors::Error
- Defined in:
- lib/paypal_client/errors.rb
Direct Known Subclasses
AuthenticationFailure, InternalServerError, InvalidRequest, MediaTypeNotAcceptable, MethodNotSupported, NotAuthorized, RateLimitReached, ResourceNotFound, ServiceUnavailable, UnprocessableEntity, UnsupportedMediaType
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#http_body ⇒ Object
readonly
Returns the value of attribute http_body.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
Instance Method Summary collapse
-
#initialize(error_message = nil, http_status: nil, http_body: nil, code: nil) ⇒ Error
constructor
A new instance of Error.
- #inspect ⇒ Object
- #message ⇒ Object
Constructor Details
#initialize(error_message = nil, http_status: nil, http_body: nil, code: nil) ⇒ Error
Returns a new instance of Error.
13 14 15 16 17 18 19 20 |
# File 'lib/paypal_client/errors.rb', line 13 def initialize( = nil, http_status: nil, http_body: nil, code: nil) @error_message = @http_status = http_status @http_body = http_body @code = code super(@error) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
8 9 10 |
# File 'lib/paypal_client/errors.rb', line 8 def code @code end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
11 12 13 |
# File 'lib/paypal_client/errors.rb', line 11 def @error_message end |
#http_body ⇒ Object (readonly)
Returns the value of attribute http_body.
9 10 11 |
# File 'lib/paypal_client/errors.rb', line 9 def http_body @http_body end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
10 11 12 |
# File 'lib/paypal_client/errors.rb', line 10 def http_status @http_status end |
Instance Method Details
#inspect ⇒ Object
22 23 24 25 26 27 |
# File 'lib/paypal_client/errors.rb', line 22 def inspect extra = [] extra << " status_code: #{http_status}" unless http_status.nil? extra << " body: #{http_body}" unless http_body.nil? "#<#{self.class.name}: #{}#{extra.join}>" end |
#message ⇒ Object
29 30 31 |
# File 'lib/paypal_client/errors.rb', line 29 def "#{code}: #{} (#{http_status})" end |