getCause(Throwable): Added detection of SQLException and its

getNextException() method pointed out by Costin M., Paul Jack, and
Nicola Ken Barozzi.  They've also suggested some more general patterns
which we're discussing the addition of on the
commons-dev@jakarta.apache.org list.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136964 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Rall 2002-08-13 19:58:49 +00:00
parent 72200fffeb
commit f740ef8893
1 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.SQLException;
/**
* Utility routines for manipulating <code>Throwable</code> objects.
@ -110,6 +111,10 @@ else if (t instanceof NestableRuntimeException)
{
cause = ((NestableRuntimeException) t).getCause();
}
else if (t instanceof SQLException)
{
cause = ((SQLException) t).getNextException();
}
else
{
Method getCause = null;