class PurpleAirApi::V1::BaseError
A custom error class for rescuing from all PurpleAir API errors
Attributes
error_type[R]
response_object[R]
Public Class Methods
new(message, error_type, response_object)
click to toggle source
Initialize the error object with error_type
and the Faraday response object. PurpleAir returns a human friendly error message and type which is added here. You can also reference the response to view the raw response from PurpleAir. @!method initialize(message, error_type
, response_object
) @param message [String] the message you want displayed when the error is raised @param error_type
[String] the error type that PurpleAir includes in the JSON response @param response_object
[Faraday::Env] the Faraday response object
Calls superclass method
# File lib/purple_air_api/V1/errors.rb, line 16 def initialize(message, error_type, response_object) super(message) @error_type = error_type @response_object = response_object end