Sha256: ca29eed12fdb9fc4260ec9f6e57801473fccc9a1b482014cdb3b86ce135d99e8

Contents?: true

Size: 368 Bytes

Versions: 33

Compression:

Stored size: 368 Bytes

Contents

module Msgr

  # Abstract error base class
  class CausedByError < StandardError
    attr_accessor :cause

    def initialize(*args)
      opts = args.extract_options!
      @cause = opts.delete(:cause)
      super
    end

    def message
      cause ? "#{super}\n  caused by:\n#{cause.to_s}" : super
    end
  end

  class ConnectionError < CausedByError

  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
msgr-0.14.1.1.b125 lib/msgr/errors.rb
msgr-0.14.1.1.b124 lib/msgr/errors.rb
msgr-0.14.1.1.b112 lib/msgr/errors.rb
msgr-0.14.1.1.b111 lib/msgr/errors.rb
msgr-0.14.1.1.b110 lib/msgr/errors.rb
msgr-0.14.1 lib/msgr/errors.rb
msgr-0.14.0 lib/msgr/errors.rb
msgr-0.13.0 lib/msgr/errors.rb
msgr-0.12.3 lib/msgr/errors.rb
msgr-0.12.2 lib/msgr/errors.rb
msgr-0.12.1 lib/msgr/errors.rb
msgr-0.12.0 lib/msgr/errors.rb
msgr-0.11.1 lib/msgr/errors.rb
msgr-0.11.0 lib/msgr/errors.rb
msgr-0.11.0.rc3 lib/msgr/errors.rb
msgr-0.11.0.rc2 lib/msgr/errors.rb
msgr-0.11.0.rc1 lib/msgr/errors.rb
msgr-0.10.2 lib/msgr/errors.rb
msgr-0.10.1 lib/msgr/errors.rb
msgr-0.10.0 lib/msgr/errors.rb