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:
parent
72200fffeb
commit
f740ef8893
|
@ -56,6 +56,7 @@ package org.apache.commons.lang.exception;
|
|||
|
||||
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 @@ public class ExceptionUtils
|
|||
{
|
||||
cause = ((NestableRuntimeException) t).getCause();
|
||||
}
|
||||
else if (t instanceof SQLException)
|
||||
{
|
||||
cause = ((SQLException) t).getNextException();
|
||||
}
|
||||
else
|
||||
{
|
||||
Method getCause = null;
|
||||
|
|
Loading…
Reference in New Issue