Exception: Lightstreamer::ProtocolError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/lightstreamer/protocol_error.rb

Overview

This error class is raised by Session when a request to the Lightstreamer API fails with a Lightstreamer-specific error code and error message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error, code) ⇒ ProtocolError

Initializes this protocol error with the specific message and code.

Parameters:

  • error (String)

    The error description.

  • code (Integer)

    The numeric code for the error.



15
16
17
18
19
20
# File 'lib/lightstreamer/protocol_error.rb', line 15

def initialize(error, code)
  @error = error.to_s
  @code = code.to_i

  super "Lightstreamer error: #{@error}, code: #{code}"
end

Instance Attribute Details

#codeFixnum (readonly)

Returns The numeric code of the Lightstreamer error.

Returns:

  • (Fixnum)

    The numeric code of the Lightstreamer error.



9
10
11
# File 'lib/lightstreamer/protocol_error.rb', line 9

def code
  @code
end

#errorString (readonly)

Returns A description of the Lightstreamer error that occurred.

Returns:

  • (String)

    A description of the Lightstreamer error that occurred.



6
7
8
# File 'lib/lightstreamer/protocol_error.rb', line 6

def error
  @error
end