Sha256: 2195a8280d0702487cb5c53f8c4b69cfea1b320adb801b52aa03496af8a7c30e

Contents?: true

Size: 391 Bytes

Versions: 24

Compression:

Stored size: 391 Bytes

Contents

# frozen_string_literal: true
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}" : super
    end
  end

  class ConnectionError < CausedByError
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
msgr-0.15.2.1.b157 lib/msgr/errors.rb
msgr-0.15.2.1.b156 lib/msgr/errors.rb
msgr-0.15.2.1.b155 lib/msgr/errors.rb
msgr-0.15.2.1.b154 lib/msgr/errors.rb
msgr-0.15.2.1.b152 lib/msgr/errors.rb
msgr-0.15.1.1.b151 lib/msgr/errors.rb
msgr-0.15.2 lib/msgr/errors.rb
msgr-0.15.1.1.b150 lib/msgr/errors.rb
msgr-0.15.1.1.b146 lib/msgr/errors.rb
msgr-0.15.1.1.b145 lib/msgr/errors.rb
msgr-0.15.1.1.b144 lib/msgr/errors.rb
msgr-0.15.1.1.b143 lib/msgr/errors.rb
msgr-0.15.1.1.b141 lib/msgr/errors.rb
msgr-0.15.0.1.b140 lib/msgr/errors.rb
msgr-0.15.1 lib/msgr/errors.rb
msgr-0.15.0.1.b139 lib/msgr/errors.rb
msgr-0.15.0.1.b136 lib/msgr/errors.rb
msgr-0.15.0.1.b135 lib/msgr/errors.rb
msgr-0.15.0.1.b134 lib/msgr/errors.rb
msgr-0.15.0.1.b131 lib/msgr/errors.rb