Exception: Lightstreamer::RequestError
- Inherits:
-
StandardError
- Object
- StandardError
- Lightstreamer::RequestError
- Defined in:
- lib/lightstreamer/request_error.rb
Overview
This error class is raised by Session when a request to the Lightstreamer API fails.
Instance Attribute Summary collapse
-
#error ⇒ String
readonly
A description of the error that occurred when the request was attempted.
-
#http_code ⇒ Fixnum
readonly
The HTTP code that was returned, or
nilif unknown.
Instance Method Summary collapse
-
#initialize(error, http_code = nil) ⇒ RequestError
constructor
Initializes this request error with a message and an HTTP code.
Constructor Details
#initialize(error, http_code = nil) ⇒ RequestError
Initializes this request error with a message and an HTTP code.
14 15 16 17 18 19 |
# File 'lib/lightstreamer/request_error.rb', line 14 def initialize(error, http_code = nil) @error = error.to_s @http_code = http_code ? http_code.to_i : nil super "Request error: #{error}#{http_code ? ", http code: #{http_code}" : ''}" end |
Instance Attribute Details
#error ⇒ String (readonly)
Returns A description of the error that occurred when the request was attempted.
5 6 7 |
# File 'lib/lightstreamer/request_error.rb', line 5 def error @error end |
#http_code ⇒ Fixnum (readonly)
Returns The HTTP code that was returned, or nil if unknown.
8 9 10 |
# File 'lib/lightstreamer/request_error.rb', line 8 def http_code @http_code end |