Class: PaypalServerSdk::OAuthProviderException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- PaypalServerSdk::OAuthProviderException
- Defined in:
- lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb
Overview
OAuth 2 Authorization endpoint exception.
Instance Attribute Summary collapse
-
#error ⇒ OAuthProviderError
Gets or sets error code.
-
#error_description ⇒ String
Gets or sets human-readable text providing additional information on error.
-
#error_uri ⇒ String
Gets or sets a URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ OAuthProviderException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ OAuthProviderException
The constructor.
32 33 34 35 36 |
# File 'lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb', line 32 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#error ⇒ OAuthProviderError
Gets or sets error code.
14 15 16 |
# File 'lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb', line 14 def error @error end |
#error_description ⇒ String
Gets or sets human-readable text providing additional information on error. Used to assist the client developer in understanding the error that occurred.
21 22 23 |
# File 'lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb', line 21 def error_description @error_description end |
#error_uri ⇒ String
Gets or sets a URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.
27 28 29 |
# File 'lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb', line 27 def error_uri @error_uri end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
41 42 43 44 45 46 |
# File 'lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb', line 41 def unbox(hash) @error = hash.key?('error') ? hash['error'] : nil @error_description = hash.key?('error_description') ? hash['error_description'] : SKIP @error_uri = hash.key?('error_uri') ? hash['error_uri'] : SKIP end |