org.specrunner.util
Class UtilException

java.lang.Object
  extended by org.specrunner.util.UtilException

public final class UtilException
extends Object

Exception utilities.

Author:
Thiago Santos

Method Summary
static String toString(Throwable exception, Boolean fullTrace)
          Dump exception trace to a string.
static Throwable unwrapException(Throwable error)
          Unwrap SpecRunner subclasses exception to find root cause.
static Throwable unwrapPresentation(Throwable error)
          Unwrap SpecRunner IPresentation to find root cause.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toString

public static String toString(Throwable exception,
                              Boolean fullTrace)
Dump exception trace to a string.

Parameters:
exception - The exception.
fullTrace - Full trace flag.
Returns:
The error String representation.

unwrapException

public static Throwable unwrapException(Throwable error)
Unwrap SpecRunner subclasses exception to find root cause. If none is found, the most specific exception is returned.

Parameters:
error - The error.
Returns:
The unwrapped exception.

unwrapPresentation

public static Throwable unwrapPresentation(Throwable error)
Unwrap SpecRunner IPresentation to find root cause.

Parameters:
error - The error.
Returns:
The unwrapped exception.


Copyright © 2015. All rights reserved.