Exception: Lightstreamer::RequestError

Inherits:
Error
  • Object
show all
Defined in:
lib/lightstreamer/errors.rb

Overview

This error is raised when an HTTP request error occurs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

build

Constructor Details

#initialize(message, code) ⇒ RequestError

Initializes this request error with a message and an HTTP code.

Parameters:

  • message (String)

    The error description.

  • code (Integer)

    The HTTP code for the request failure, if known.



148
149
150
151
152
153
# File 'lib/lightstreamer/errors.rb', line 148

def initialize(message, code)
  @request_error_message = message
  @request_error_code = code.to_i

  super "Request error #{code}: #{message}"
end

Instance Attribute Details

#request_error_codeFixnum (readonly)

Returns The HTTP code that was returned, or zero if unknown.

Returns:

  • (Fixnum)

    The HTTP code that was returned, or zero if unknown.



142
143
144
# File 'lib/lightstreamer/errors.rb', line 142

def request_error_code
  @request_error_code
end

#request_error_messageString (readonly)

Returns A description of the request error that occurred.

Returns:

  • (String)

    A description of the request error that occurred.



139
140
141
# File 'lib/lightstreamer/errors.rb', line 139

def request_error_message
  @request_error_message
end