Exception: Wirer::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Wirer::Error
- Defined in:
- lib/wirer/errors.rb
Overview
Thank you to rubyforge.org/projects/nestegg for the pattern
Direct Known Subclasses
CyclicDependencyError, DependencyConstructionError, DependencyFindingError
Instance Attribute Summary collapse
-
#cause ⇒ Object
(also: #wrapped_error)
readonly
Returns the value of attribute cause.
Instance Method Summary collapse
-
#initialize(msg, cause = $ERROR_INFO) ⇒ Error
constructor
A new instance of Error.
- #set_backtrace(bt) ⇒ Object
Constructor Details
#initialize(msg, cause = $ERROR_INFO) ⇒ Error
Returns a new instance of Error.
9 10 11 12 |
# File 'lib/wirer/errors.rb', line 9 def initialize(msg, cause = $ERROR_INFO) @cause = cause super(msg || cause && cause.) end |
Instance Attribute Details
#cause ⇒ Object (readonly) Also known as: wrapped_error
Returns the value of attribute cause.
6 7 8 |
# File 'lib/wirer/errors.rb', line 6 def cause @cause end |
Instance Method Details
#set_backtrace(bt) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/wirer/errors.rb', line 14 def set_backtrace(bt) if cause cause.backtrace.reverse.each do |line| bt.last == line ? bt.pop : break end bt << "cause: #{cause.class.name}: #{cause}" bt.concat cause.backtrace end super(bt) end |