Class: Nylas::NylasApiError
- Inherits:
- 
      AbstractNylasApiError
      
        - Object
- AbstractNylasApiError
- Nylas::NylasApiError
 
- Defined in:
- lib/nylas/errors.rb
Overview
Error class representing a failed response from the Nylas API.
Instance Attribute Summary collapse
- 
  
    
      #provider_error  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute provider_error. 
- 
  
    
      #request_id  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute request_id. 
- 
  
    
      #status_code  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute status_code. 
- 
  
    
      #type  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute type. 
Class Method Summary collapse
- 
  
    
      .parse_error_response(response, status_code)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Parses the error response. 
Instance Method Summary collapse
- 
  
    
      #initialize(type, message, status_code, provider_error = nil, request_id = nil)  ⇒ NylasApiError 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    Initializes an error and assigns the given attributes to it. 
Constructor Details
#initialize(type, message, status_code, provider_error = nil, request_id = nil) ⇒ NylasApiError
Initializes an error and assigns the given attributes to it.
| 26 27 28 29 30 31 32 | # File 'lib/nylas/errors.rb', line 26 def initialize(type, , status_code, provider_error = nil, request_id = nil) super() self.type = type self.status_code = status_code self.provider_error = provider_error self.request_id = request_id end | 
Instance Attribute Details
#provider_error ⇒ Object
Returns the value of attribute provider_error.
| 17 18 19 | # File 'lib/nylas/errors.rb', line 17 def provider_error @provider_error end | 
#request_id ⇒ Object
Returns the value of attribute request_id.
| 17 18 19 | # File 'lib/nylas/errors.rb', line 17 def request_id @request_id end | 
#status_code ⇒ Object
Returns the value of attribute status_code.
| 17 18 19 | # File 'lib/nylas/errors.rb', line 17 def status_code @status_code end | 
#type ⇒ Object
Returns the value of attribute type.
| 17 18 19 | # File 'lib/nylas/errors.rb', line 17 def type @type end | 
Class Method Details
.parse_error_response(response, status_code) ⇒ Object
Parses the error response.
| 38 39 40 41 42 43 44 45 | # File 'lib/nylas/errors.rb', line 38 def self.parse_error_response(response, status_code) new( response["type"], response["message"], status_code, response["provider_error"] ) end |