Berkeley DB Java Edition
version 1.5.1

com.sleepycat.util
Class ExceptionUnwrapper

java.lang.Object
  |
  +--com.sleepycat.util.ExceptionUnwrapper

public class ExceptionUnwrapper
extends Object

Unwraps nested exceptions by calling the ExceptionWrapper.getDetail() method for exceptions that implement the ExceptionWrapper interface. Does not currently support the Java 1.4 Throwable.getDetail() method.

Author:
Mark Hayes

Constructor Summary
ExceptionUnwrapper()
           
 
Method Summary
static Exception unwrap(Exception e)
          Unwraps an Exception and returns the underlying Exception, or throws an Error if the underlying Throwable is an Error.
static Throwable unwrapAny(Throwable e)
          Unwraps an Exception and returns the underlying Throwable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionUnwrapper

public ExceptionUnwrapper()
Method Detail

unwrap

public static Exception unwrap(Exception e)
Unwraps an Exception and returns the underlying Exception, or throws an Error if the underlying Throwable is an Error.

Parameters:
e - is the Exception to unwrap.
Returns:
the underlying Exception.
Throws:
Error - if the underlying Throwable is an Error.
IllegalArgumentException - if the underlying Throwable is not an Exception or an Error.

unwrapAny

public static Throwable unwrapAny(Throwable e)
Unwraps an Exception and returns the underlying Throwable.

Parameters:
e - is the Exception to unwrap.
Returns:
the underlying Throwable.

Berkeley DB Java Edition
version 1.5.1

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.