Exception: StartupStats::Error::ClientError
- Inherits:
-
StartupStats::Error
- Object
- StandardError
- StartupStats::Error
- StartupStats::Error::ClientError
- Defined in:
- lib/startupstats/error/client_error.rb
Overview
Raised when a StartupStats API returns a 4xx HTTP status code or there’s an error in Faraday
Direct Known Subclasses
BadRequest, Forbidden, NotAcceptable, NotFound, Unauthorized
Instance Attribute Summary
Attributes inherited from StartupStats::Error
Class Method Summary collapse
-
.from_response(response = {}) ⇒ StartupStats::Error
Create a new error from an HTTP environment.
Methods inherited from StartupStats::Error
#backtrace, descendants, errors, #initialize
Constructor Details
This class inherits a constructor from StartupStats::Error
Class Method Details
.from_response(response = {}) ⇒ StartupStats::Error
Create a new error from an HTTP environment
12 13 14 |
# File 'lib/startupstats/error/client_error.rb', line 12 def self.from_response(response={}) new(parse_error(response[:body]), response[:response_headers]) end |