Exception: MdNotes::OAuthProviderException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- MdNotes::OAuthProviderException
- Defined in:
- lib/md_notes/exceptions/o_auth_provider_exception.rb
Overview
OAuth 2 Authorization endpoint exception.
Instance Attribute Summary collapse
-
#error ⇒ OAuthProviderErrorEnum
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.
Attributes inherited from APIException
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.
29 30 31 32 33 |
# File 'lib/md_notes/exceptions/o_auth_provider_exception.rb', line 29 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#error ⇒ OAuthProviderErrorEnum
Gets or sets error code.
11 12 13 |
# File 'lib/md_notes/exceptions/o_auth_provider_exception.rb', line 11 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.
18 19 20 |
# File 'lib/md_notes/exceptions/o_auth_provider_exception.rb', line 18 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.
24 25 26 |
# File 'lib/md_notes/exceptions/o_auth_provider_exception.rb', line 24 def error_uri @error_uri end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
38 39 40 41 42 |
# File 'lib/md_notes/exceptions/o_auth_provider_exception.rb', line 38 def unbox(hash) @error = hash['error'] @error_description = hash['error_description'] @error_uri = hash['error_uri'] end |