Exception: Twingly::LiveFeed::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Twingly::LiveFeed::Error
show all
- Defined in:
- lib/twingly/livefeed/error.rb
Class Method Summary
collapse
Class Method Details
.from_api_response(code, message) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/twingly/livefeed/error.rb', line 6
def self.from_api_response(code, message)
error =
case code.to_s
when /^400/, /^404/
QueryError
when /^401/
AuthenticationError
else
ServerError
end
error.new("#{message} (code: #{code})")
end
|