Exception subclass raised when there is an error encountered upon querying or posting to the remote Twitter REST API.
To consume and query any RESTError raised by Twitter4R:
begin # Do something with your instance of <tt>Twitter::Client</tt>. # Maybe something like: timeline = twitter.timeline_for(:public) rescue RESTError => re puts re.code, re.message, re.uri end
Which on the code raising a RESTError will output something like:
404 Resource Not Found /i_am_crap.json
Methods
Included Modules
- ClassUtilMixin
- Twitter::RailsPatch
Attributes
| [RW] | code | |
| [RW] | message | |
| [RW] | uri |
Public Instance methods
[ show source ]
# File lib/twitter/rails.rb, line 85
85: def to_hash
86: { :code => @code, :message => @message, :uri => @uri }
87: end
Returns string in following format:
"HTTP #{@code}: #{@message} at #{@uri}"
For example,
"HTTP 404: Resource Not Found at /i_am_crap.json"
[ show source ]
# File lib/twitter/core.rb, line 111
111: def to_s
112: "HTTP #{@code}: #{@message} at #{@uri}"
113: end