Exception: Recurly::Errors::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Recurly::Errors::APIError
- Defined in:
- lib/recurly/errors.rb
Direct Known Subclasses
BadRequestError, ImmutableSubscriptionError, InternalServerError, InvalidApiKeyError, InvalidApiVersionError, InvalidContentTypeError, InvalidPermissionsError, InvalidTokenError, MissingFeatureError, NotFoundError, SimultaneousRequestError, TransactionError, UnauthorizedError, UnavailableInApiVersionError, UnknownApiVersionError, ValidationError
Instance Attribute Summary collapse
-
#recurly_error ⇒ Object
Returns the value of attribute recurly_error.
Class Method Summary collapse
-
.error_class(error_key) ⇒ Errors::APIError, Errors::NetworkError
Looks up an Error class by name.
Instance Method Summary collapse
- #get_response ⇒ Object
-
#initialize(response, error) ⇒ APIError
constructor
A new instance of APIError.
- #status_code ⇒ Object
Constructor Details
#initialize(response, error) ⇒ APIError
Returns a new instance of APIError.
20 21 22 23 24 |
# File 'lib/recurly/errors.rb', line 20 def initialize(response, error) super(error.) @response = response @recurly_error = error end |
Instance Attribute Details
#recurly_error ⇒ Object
Returns the value of attribute recurly_error.
6 7 8 |
# File 'lib/recurly/errors.rb', line 6 def recurly_error @recurly_error end |
Class Method Details
.error_class(error_key) ⇒ Errors::APIError, Errors::NetworkError
Looks up an Error class by name
14 15 16 17 18 |
# File 'lib/recurly/errors.rb', line 14 def self.error_class(error_key) class_name = error_key.split("_").map(&:capitalize).join class_name += "Error" unless class_name.end_with?("Error") Errors.const_get(class_name) end |
Instance Method Details
#get_response ⇒ Object
30 31 32 |
# File 'lib/recurly/errors.rb', line 30 def get_response @response end |
#status_code ⇒ Object
26 27 28 |
# File 'lib/recurly/errors.rb', line 26 def status_code @response.status end |