From be582b41f875d0c42b12fc850d13cc265d5a5c2f Mon Sep 17 00:00:00 2001 From: baztian Date: Wed, 12 Feb 2014 23:57:57 +0100 Subject: [PATCH] Retrieve message for Jython SQLExceptions --- src/jaydebeapi/dbapi2.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jaydebeapi/dbapi2.py b/src/jaydebeapi/dbapi2.py index a3e6655..8051ec3 100644 --- a/src/jaydebeapi/dbapi2.py +++ b/src/jaydebeapi/dbapi2.py @@ -44,7 +44,8 @@ _handle_sql_exception = None def _handle_sql_exception_jython(ex): from java.sql import SQLException if isinstance(ex, SQLException): - raise Error + # TODO get stacktrace + raise Error, ex.getMessage() else: raise ex @@ -106,6 +107,7 @@ def _handle_sql_exception_jpype(ex): import jpype SQLException = jpype.java.sql.SQLException if issubclass(ex.__javaclass__, SQLException): + # TODO get message and stacktrace raise Error else: raise ex