Exception: Rubyists::Leopard::LeopardError
- Inherits:
-
StandardError
- Object
- StandardError
- Rubyists::Leopard::LeopardError
- Defined in:
- lib/leopard/errors.rb
Direct Known Subclasses
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize ⇒ LeopardError
constructor
A new instance of LeopardError.
Constructor Details
#initialize ⇒ LeopardError
Returns a new instance of LeopardError.
6 7 8 9 |
# File 'lib/leopard/errors.rb', line 6 def initialize(...) super set_backtrace(caller) end |
Instance Method Details
#backtrace ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/leopard/errors.rb', line 11 def backtrace # If the backtrace is nil, return an empty array orig = (super || [])[0..3] # If the backtrace is less than 4 lines, return it as is return orig if orig.size < 4 # Otherwise, add a note indicating truncation orig + ['... (truncated by Leopard)'] end |