Method: OAuth2::Error#initialize
- Defined in:
- lib/oauth2/error.rb
#initialize(response) ⇒ Error
standard error values include: :invalid_request, :invalid_client, :invalid_token, :invalid_grant, :unsupported_grant_type, :invalid_scope
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/oauth2/error.rb', line 7 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 super(.join("\n")) end |