class Lightstreamer::LightstreamerError
Base class for all errors raised by this gem.
Constants
- API_ERROR_CODE_TO_CLASS
Public Class Methods
build(message, code)
click to toggle source
Takes a Lightstreamer
error message and numeric code and returns an instance of the relevant error class that should be raised in response to the error.
@param [String] message The error message. @param [Fixnum] code The numeric error code that is used to determine which {LightstreamerError} subclass to
instantiate.
@return [LightstreamerError]
@private
# File lib/lightstreamer/errors.rb, line 188 def self.build(message, code) code = code.to_i if API_ERROR_CODE_TO_CLASS.key? code API_ERROR_CODE_TO_CLASS[code].new '' elsif code <= 0 Errors::MetadataAdapterError.new message, code else new "#{code}: #{message}" end end