Exception: OAuth2::Error
- Inherits:
-
StandardError
- Object
- StandardError
- OAuth2::Error
- Defined in:
- lib/omniauth/strategies/mvc.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ Error
constructor
standard error values include: :invalid_request, :invalid_client, :invalid_token, :invalid_grant, :unsupported_grant_type, :invalid_scope.
Constructor Details
#initialize(response) ⇒ Error
standard error values include: :invalid_request, :invalid_client, :invalid_token, :invalid_grant, :unsupported_grant_type, :invalid_scope
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/omniauth/strategies/mvc.rb', line 113 def initialize(response) response.error = self @response = response = [] if response.parsed.is_a?(Hash) @code = response.parsed['error'] @description = response.parsed['error_description'] << "#{@code}: #{@description}" end << response.body.force_encoding("UTF-8") super(.join("\n")) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
109 110 111 |
# File 'lib/omniauth/strategies/mvc.rb', line 109 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
109 110 111 |
# File 'lib/omniauth/strategies/mvc.rb', line 109 def description @description end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
109 110 111 |
# File 'lib/omniauth/strategies/mvc.rb', line 109 def response @response end |