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.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
-
#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
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
58 59 60 61 62 |
# File 'lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb', line 58 def inspect class_name = self.class.name.split('::').last "<#{class_name} error: #{@error.inspect}, error_description: #{@error_description.inspect},"\ " error_uri: #{@error_uri.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
51 52 53 54 55 |
# File 'lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb', line 51 def to_s class_name = self.class.name.split('::').last "<#{class_name} error: #{@error}, error_description: #{@error_description}, error_uri:"\ " #{@error_uri}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
41 42 43 44 45 46 47 48 |
# File 'lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb', line 41 def unbox(hash) return nil unless 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 |