Class: Intake::ExceptionFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/intake/exception_formatter.rb

Overview

Base class that formats exception object to string

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExceptionFormatter

Returns a new instance of ExceptionFormatter.



8
9
10
11
# File 'lib/intake/exception_formatter.rb', line 8

def initialize
  @backtrace = true
  @cause = true
end

Instance Attribute Details

#backtraceObject

Returns the value of attribute backtrace.



6
7
8
# File 'lib/intake/exception_formatter.rb', line 6

def backtrace
  @backtrace
end

#causeObject

Returns the value of attribute cause.



6
7
8
# File 'lib/intake/exception_formatter.rb', line 6

def cause
  @cause
end

Instance Method Details

#call(err) ⇒ Object

Formats error to string



14
15
16
# File 'lib/intake/exception_formatter.rb', line 14

def call(err)
  format(err, []).join("\n")
end