Exception: Msgr::CausedByError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/msgr/errors.rb

Overview

Abstract error base class

Direct Known Subclasses

ConnectionError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ CausedByError

Returns a new instance of CausedByError.



8
9
10
11
12
# File 'lib/msgr/errors.rb', line 8

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

Instance Attribute Details

#causeObject

Returns the value of attribute cause.



6
7
8
# File 'lib/msgr/errors.rb', line 6

def cause
  @cause
end

Instance Method Details

#messageObject



14
15
16
# File 'lib/msgr/errors.rb', line 14

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