Sha256: ae04ded7d71952a9ddae6d80874d28d9ee0f0584660561fd28aa2eee19283a6b
Contents?: true
Size: 649 Bytes
Versions: 14
Compression:
Stored size: 649 Bytes
Contents
module OAuth2 class Error < StandardError attr_reader :response, :code, :description # standard error values include: # :invalid_request, :invalid_client, :invalid_token, :invalid_grant, :unsupported_grant_type, :invalid_scope def initialize(response) response.error = self @response = response message = [] if response.parsed.is_a?(Hash) @code = response.parsed['error'] @description = response.parsed['error_description'] message << "#{@code}: #{@description}" end message << response.body.force_encoding('UTF-8') super(message.join("\n")) end end end
Version data entries
14 entries across 14 versions & 1 rubygems