Exception: Keycardai::OAuth::OAuthError

Inherits:
HTTPError show all
Defined in:
lib/keycardai/oauth/errors.rb

Overview

An OAuth error response from the authorization server (RFC 6749 ยง5.2). Carries the wire error code plus the optional description and URI.

Instance Attribute Summary collapse

Attributes inherited from HTTPError

#body, #status

Instance Method Summary collapse

Constructor Details

#initialize(message, error:, status:, body: "", error_description: nil, error_uri: nil) ⇒ OAuthError

Returns a new instance of OAuthError.



41
42
43
44
45
46
# File 'lib/keycardai/oauth/errors.rb', line 41

def initialize(message, error:, status:, body: "", error_description: nil, error_uri: nil)
  super(message, status: status, body: body)
  @error = error
  @error_description = error_description
  @error_uri = error_uri
end

Instance Attribute Details

#errorString (readonly)

Returns the OAuth error code (e.g. invalid_grant).

Returns:

  • (String)

    the OAuth error code (e.g. invalid_grant)



35
36
37
# File 'lib/keycardai/oauth/errors.rb', line 35

def error
  @error
end

#error_descriptionString? (readonly)

Returns:

  • (String, nil)


37
38
39
# File 'lib/keycardai/oauth/errors.rb', line 37

def error_description
  @error_description
end

#error_uriString? (readonly)

Returns:

  • (String, nil)


39
40
41
# File 'lib/keycardai/oauth/errors.rb', line 39

def error_uri
  @error_uri
end