Module: R10K::Errors::Formatting
- Defined in:
- lib/r10k/errors/formatting.rb
Class Method Summary collapse
-
.format_exception(exc, with_backtrace = false) ⇒ String
Format this exception for displaying to the user.
Class Method Details
.format_exception(exc, with_backtrace = false) ⇒ String
Format this exception for displaying to the user
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/r10k/errors/formatting.rb', line 14 def format_exception(exc, with_backtrace = false) lines = [] lines << exc. if with_backtrace lines.concat(exc.backtrace) end if exc.respond_to?(:original) && exc.original lines << "Original exception:" lines<< format_exception(exc.original, with_backtrace) end lines.join("\n") end |