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