Top Level Namespace

Defined Under Namespace

Modules: CoreExtensions, IB, IBSupport, Support Classes: FalseClass, NilClass, Numeric, Object, String, Symbol, Time, TrueClass

Constant Summary collapse

IbRuby =
IB
Ib =
IB
MIN_CLIENT_VER =

100 = enhanced handshake, msg length prefixes

100
MAX_CLIENT_VER =
137

Instance Method Summary collapse

Instance Method Details

#error(message, type = :standard, backtrace = nil) ⇒ Object

Patching Object with universally accessible top level error method. The method is used throughout the lib instead of plainly raising exceptions. This allows lib user to easily inject user-specific error handling into the lib by just replacing Object#error method.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/ib/errors.rb', line 27

def error message, type=:standard, backtrace=nil
  e = case type
  when :standard
    IB::Error.new message
  when :args
    IB::ArgumentError.new message
  when :symbol
    IB::SymbolError.new message
  when :load
    IB::LoadError.new message
  when :flex
    IB::FlexError.new message
  when :reader
    IB::TransmissionError.new message
  when :verify
    IB::VerifyError.new message
  end
  e.set_backtrace(caller) if backtrace
  raise e
end