class Cascading::CascadingException

NativeException wrapper that prints the full nested stack trace of the Java exception and all of its causes wrapped by the NativeException. NativeException by default reveals only the first cause, which is insufficient for tracing cascading.jruby errors into JRuby code or revealing underlying Janino expression problems.

Attributes

depth[RW]
ne[RW]

Public Instance Methods

cause(depth = @depth) click to toggle source

Fetch cause at depth. If depth is not provided, root cause is returned.

# File lib/cascading/cascading_exception.rb, line 18
def cause(depth = @depth)
  if depth > @depth
    warn "WARNING: Depth (#{depth}) greater than depth of cause stack (#{@depth}) requested"
    nil
  else
    fetch_cause(@ne, depth)
  end
end

Public Class Methods

new(native_exception, message) click to toggle source
# File lib/cascading/cascading_exception.rb, line 10
def initialize(native_exception, message)
  @ne = native_exception
  trace, @depth = trace_causes(@ne, 1)
  summary, _ = trace_causes(@ne, 1, true)
  super("#{message}\n#{trace}\nException summary for: #{message}\n#{summary}")
end