Author: arminw
Date: Sun Jan 8 12:09:08 2006
New Revision: 367083
URL: http://svn.apache.org/viewcvs?rev=367083&view=rev
Log:
improve error log
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/oql/OQLQueryImpl.java
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/oql/OQLQueryImpl.java
URL:
http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/oql/OQLQueryImpl.java?rev=367083&r1=367082&r2=367083&view=diff
==============================================================================
---
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/oql/OQLQueryImpl.java
(original)
+++
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/odmg/oql/OQLQueryImpl.java
Sun Jan 8 12:09:08 2006
@@ -44,8 +44,12 @@
import org.apache.ojb.odmg.PBCapsule;
import org.apache.ojb.odmg.RuntimeObject;
import org.apache.ojb.odmg.TransactionImpl;
+import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang.SystemUtils;
import org.odmg.QueryInvalidException;
import org.odmg.Transaction;
+import org.odmg.QueryParameterCountInvalidException;
+import org.odmg.QueryParameterTypeInvalidException;
/**
* The OQL query interface implementation.
@@ -115,7 +119,7 @@
* not correspond with the type of the parameter in the query.
*/
public void bind(Object parameter)
- throws org.odmg.QueryParameterCountInvalidException,
org.odmg.QueryParameterTypeInvalidException
+ throws QueryParameterCountInvalidException,
QueryParameterTypeInvalidException
{
try
{
@@ -130,7 +134,9 @@
}
catch (Exception e)
{
- throw new
org.odmg.QueryParameterCountInvalidException(e.getMessage());
+ Throwable t = ExceptionUtils.getRootCause(e);
+ if(t == null) t = e;
+ throw new QueryParameterCountInvalidException("Root exception is:"
+ SystemUtils.LINE_SEPARATOR + ExceptionUtils.getFullStackTrace(t));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]