Exception: Zoreal::OAuth2::ExchangeError

Inherits:
Error
  • Object
show all
Defined in:
lib/zoreal/oauth2/errors.rb

Overview

The provider refused the code exchange. oauth_error is the RFC 6749 error code and description the provider's own reason, verbatim: the provider's words are the only signal that says WHY (a consumed code, a PKCE mismatch, a lapsed sector), and rewriting them hides it.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(oauth_error, description, status: nil) ⇒ ExchangeError

Returns a new instance of ExchangeError.



15
16
17
18
19
20
# File 'lib/zoreal/oauth2/errors.rb', line 15

def initialize(oauth_error, description, status: nil)
  @oauth_error = oauth_error
  @description = description
  @status = status
  super([oauth_error, description].compact.join(': '))
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



13
14
15
# File 'lib/zoreal/oauth2/errors.rb', line 13

def description
  @description
end

#oauth_errorObject (readonly)

Returns the value of attribute oauth_error.



13
14
15
# File 'lib/zoreal/oauth2/errors.rb', line 13

def oauth_error
  @oauth_error
end

#statusObject (readonly)

Returns the value of attribute status.



13
14
15
# File 'lib/zoreal/oauth2/errors.rb', line 13

def status
  @status
end