[Zope] Catching SQL Exceptions in an external method

Stolker, Wim w.t.stolker@getronics.com
Tue, 23 May 2000 12:17:40 +0200


Hi,

I have a burning question ...

Does anyone know how to catch exceptions from
SQL methods ( via ZodbcDA ) in an external method?

I do not know how the exceptions are named.
If I catch the exception with a general 'except:' statement
it works but I cannot see the info from the exception,
so I want to write something like
	except sqlerror_or_something, e:
		do_something_with_e

I have not been able to find out what I should write 
instead of sqlerror_or_something

Some context:

I have an external method that I call via xmlrpc.
This method calls a ZSQL method, does some postprocessing and
returns the result to the ( java or python ) client.
Everything works fine EXCEPT when there is an error.
This error shows up in the client as 'internal server error' without
further information.
If I call the external method from a browser I can see the specific
SQL error.
So I tried to catch the specific error in the external method in order
to marshall the info and send it back to the client.

Any help greatly appreciated.

Have a nice day,
Wim