Exception: Escort::BaseError
- Inherits:
-
StandardError
- Object
- StandardError
- Escort::BaseError
- Includes:
- Error
- Defined in:
- lib/escort/error/error.rb
Overview
all our exceptions will supported nesting other exceptions also all our exception will be a kind_of? Escort::Error
Direct Known Subclasses
Instance Attribute Summary collapse
-
#original ⇒ Object
readonly
Returns the value of attribute original.
Instance Method Summary collapse
-
#initialize(msg, original = $!) ⇒ BaseError
constructor
A new instance of BaseError.
- #set_backtrace(bt) ⇒ Object
Constructor Details
#initialize(msg, original = $!) ⇒ BaseError
Returns a new instance of BaseError.
17 18 19 20 |
# File 'lib/escort/error/error.rb', line 17 def initialize(msg, original=$!) super(msg) @original = original end |
Instance Attribute Details
#original ⇒ Object (readonly)
Returns the value of attribute original.
15 16 17 |
# File 'lib/escort/error/error.rb', line 15 def original @original end |
Instance Method Details
#set_backtrace(bt) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/escort/error/error.rb', line 22 def set_backtrace(bt) if original original.backtrace.reverse.each do |line| bt.last == line ? bt.pop : break end original_first = original.backtrace.shift bt.concat ["#{original_first}: #{original.}"] bt.concat original.backtrace end super(bt) end |