Exception: BadGateway
- Inherits:
-
ServiceError
- Object
- StandardError
- ServiceError
- BadGateway
- Defined in:
- lib/bing/errors.rb
Overview
Raised when we get an invalid response from an underlying server
Instance Attribute Summary collapse
-
#code ⇒ Object
Status code from underlying server.
-
#text ⇒ Object
Text we were unable to parse.
-
#uri ⇒ Object
URI for this request.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object
Status code from underlying server
37 38 39 |
# File 'lib/bing/errors.rb', line 37 def code @code end |
#text ⇒ Object
Text we were unable to parse
42 43 44 |
# File 'lib/bing/errors.rb', line 42 def text @text end |
Class Method Details
.bad_response(code, uri, server_message = nil) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/bing/errors.rb', line 26 def self.bad_response code, uri, =nil = " with message #{}" if error = new "#{uri} returned #{code}#{}" error.code = code error.uri = uri error end |
.parse_error(text, uri = nil) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/bing/errors.rb', line 19 def self.parse_error text, uri = nil error = new "parse error#{uri ? " from #{uri}" : nil} - #{text.inspect}" error.text = text error.uri = uri error end |
Instance Method Details
#status ⇒ Object
49 |
# File 'lib/bing/errors.rb', line 49 def status() 502 end |