com.buck.commons.exceptions
Class Exceptions

java.lang.Object
  extended by com.buck.commons.exceptions.Exceptions

public final class Exceptions
extends Object

Provides general exception utility methods.

Author:
Robert J. Buck

Constructor Summary
Exceptions()
           
 
Method Summary
static String toStringAllCauses(Throwable what)
          Prepares an exception for display by concatenating all causation messages into one string.
static String toStringAllCauses(Throwable what, int depth)
          Prepares an exception for display by concatenating all causation messages into one string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exceptions

public Exceptions()
Method Detail

toStringAllCauses

public static String toStringAllCauses(Throwable what)
Prepares an exception for display by concatenating all causation messages into one string. This method could be used for logs where stack traces are to be avoided.

Parameters:
what - the exception for which to prepare a concatenated message
Returns:
the concatenated causation message

toStringAllCauses

public static String toStringAllCauses(Throwable what,
                                       int depth)
Prepares an exception for display by concatenating all causation messages into one string. This method could be used for logs where stack traces are to be avoided.

Parameters:
what - the exception for which to prepare a concatenated message
depth - the stack depth to which causation messages are concatenated
Returns:
the concatenated causation message


Copyright © 2013. All Rights Reserved.