Exception: OAuth2::Error
- Inherits:
- 
      StandardError
      
        - Object
- StandardError
- OAuth2::Error
 
- Defined in:
- lib/oauth2/error.rb
Instance Attribute Summary collapse
- 
  
    
      #body  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute body. 
- 
  
    
      #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 codes include: ‘invalid_request’, ‘invalid_client’, ‘invalid_token’, ‘invalid_grant’, ‘unsupported_grant_type’, ‘invalid_scope’ response might be a Response object, or the response.parsed hash. 
Constructor Details
#initialize(response) ⇒ Error
standard error codes include:
‘invalid_request’, ‘invalid_client’, ‘invalid_token’, ‘invalid_grant’, ‘unsupported_grant_type’, ‘invalid_scope’
response might be a Response object, or the response.parsed hash
| 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # File 'lib/oauth2/error.rb', line 10 def initialize(response) @response = response if response.respond_to?(:parsed) if response.parsed.is_a?(Hash) @code = response.parsed["error"] @description = response.parsed["error_description"] end elsif response.is_a?(Hash) @code = response["error"] @description = response["error_description"] end @body = if response.respond_to?(:body) response.body else @response end = parse_error_description(@code, @description) super((@body, )) end | 
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
| 5 6 7 | # File 'lib/oauth2/error.rb', line 5 def body @body end | 
#code ⇒ Object (readonly)
Returns the value of attribute code.
| 5 6 7 | # File 'lib/oauth2/error.rb', line 5 def code @code end | 
#description ⇒ Object (readonly)
Returns the value of attribute description.
| 5 6 7 | # File 'lib/oauth2/error.rb', line 5 def description @description end | 
#response ⇒ Object (readonly)
Returns the value of attribute response.
| 5 6 7 | # File 'lib/oauth2/error.rb', line 5 def response @response end |