Exception: Cascading::CascadingException
- Inherits:
-
StandardError
- Object
- StandardError
- Cascading::CascadingException
- Defined in:
- lib/cascading/cascading_exception.rb
Overview
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.
Instance Attribute Summary collapse
-
#depth ⇒ Object
Returns the value of attribute depth.
-
#ne ⇒ Object
Returns the value of attribute ne.
Instance Method Summary collapse
-
#cause(depth = @depth) ⇒ Object
Fetch cause at depth.
-
#initialize(native_exception, message) ⇒ CascadingException
constructor
A new instance of CascadingException.
Constructor Details
#initialize(native_exception, message) ⇒ CascadingException
Returns a new instance of CascadingException.
10 11 12 13 14 15 |
# File 'lib/cascading/cascading_exception.rb', line 10 def initialize(native_exception, ) @ne = native_exception trace, @depth = trace_causes(@ne, 1) summary, _ = trace_causes(@ne, 1, true) super("#{}\n#{trace}\nException summary for: #{}\n#{summary}") end |
Instance Attribute Details
#depth ⇒ Object
Returns the value of attribute depth.
8 9 10 |
# File 'lib/cascading/cascading_exception.rb', line 8 def depth @depth end |
#ne ⇒ Object
Returns the value of attribute ne.
8 9 10 |
# File 'lib/cascading/cascading_exception.rb', line 8 def ne @ne end |
Instance Method Details
#cause(depth = @depth) ⇒ Object
Fetch cause at depth. If depth is not provided, root cause is returned.
18 19 20 21 22 23 24 25 |
# 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 |