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)
          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)
                       throws IOException
Dump exception trace to a string.

Parameters:
exception - The exception.
Returns:
The error String representation.
Throws:
IOException - On dump errors.

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 © 2014. All rights reserved.