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.



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

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

Instance Attribute Details

#causeObject

Returns the value of attribute cause.



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

def cause
  @cause
end

Instance Method Details

#messageObject



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

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