ccc.commons
Class Exceptions

java.lang.Object
  extended by ccc.commons.Exceptions

public final class Exceptions
extends java.lang.Object

Helper methods when dealing with exceptions.

Author:
Civic Computing Ltd

Method Summary
static java.lang.Throwable rootCause(java.lang.Throwable t)
          Returns the root cause of this exception.
static java.lang.String stackTraceFor(java.lang.Throwable t)
          Convert the stack trace for an exception to a string.
static void swallow(java.lang.Throwable t)
          Handle an exception that we can do nothing sensible with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

stackTraceFor

public static java.lang.String stackTraceFor(java.lang.Throwable t)
Convert the stack trace for an exception to a string.

Parameters:
t - The exception for which we want the stack trace.
Returns:
The stack trace as a string.

rootCause

public static java.lang.Throwable rootCause(java.lang.Throwable t)
Returns the root cause of this exception. If the incoming Throwable instance is not null, there is always at least one root, the argument itself.

Parameters:
t - The exception to be investigated.
Returns:
Root cause of the exception.

swallow

public static void swallow(java.lang.Throwable t)
Handle an exception that we can do nothing sensible with.

Parameters:
t - The exception to ignore.


Copyright © 2010. All Rights Reserved.