Sha256: 7762b4e40d85da8c020f39f7993db15bcfe86e9a264607e4d05452b5ca585b22

Contents?: true

Size: 537 Bytes

Versions: 14

Compression:

Stored size: 537 Bytes

Contents

module IB

  # Error handling
  class Error < RuntimeError
  end

  class ArgumentError < ArgumentError
  end

  class LoadError < LoadError
  end

end # module IB

### Patching Object with universally accessible top level error method
def error message, type=:standard, backtrace=nil
  e = case type
        when :standard
          IB::Error.new message
        when :args
          IB::ArgumentError.new message
        when :load
          IB::LoadError.new message
      end
  e.set_backtrace(backtrace) if backtrace
  raise e
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ib-ruby-0.8.4 lib/ib/errors.rb
ib-ruby-0.8.3 lib/ib/errors.rb
ib-ruby-0.8.1 lib/ib-ruby/errors.rb
ib-ruby-0.8.0 lib/ib-ruby/errors.rb
ib-ruby-0.7.12 lib/ib-ruby/errors.rb
ib-ruby-0.7.11 lib/ib-ruby/errors.rb
ib-ruby-0.7.10 lib/ib-ruby/errors.rb
ib-ruby-0.7.9 lib/ib-ruby/errors.rb
ib-ruby-0.7.8 lib/ib-ruby/errors.rb
ib-ruby-0.7.6 lib/ib-ruby/errors.rb
ib-ruby-0.7.4 lib/ib-ruby/errors.rb
ib-ruby-0.7.3 lib/ib-ruby/errors.rb
ib-ruby-0.7.2 lib/ib-ruby/errors.rb
ib-ruby-0.7.0 lib/ib-ruby/errors.rb