Method: FormatException.clean

Defined in:
lib/format_exception.rb

.clean(e, context_message = nil) ⇒ String

The log-friendly format

Formats the exception as the Rails logger would, with the exception class name and message on the first line, with the backtrace on subsequent, indented lines.

If the context_message is given, it is prepended to the first line.

Parameters:

  • e (Exception)

    the exception to format

  • context_message (String) (defaults to: nil)

    the additional message to prepend to the formatted exception

Returns:

  • (String)

    the formatted exception



84
85
86
# File 'lib/format_exception.rb', line 84

def self.clean(e, context_message = nil)
  format(CLEAN_FORMAT, e, context_message)
end