Hello, I've just discovered a pretty strange behaviour.

I was positively impressed when the exceptions module was introduced and
the original DB adapter error was 'wrapped' inside exceptions.SQLError.
This was great.

What I found now is that the behaviour seems partial. Just an example: if I
try creating a brand new object violating a NOT NULL constraint, i get
SQLError raised. But if I try setting to NULL a column in an
already-existing record, i get the original psycopg.ProgrammingError
raised.

This seems related to the try-except block raising the custom exception,
which seems to be present in engine.SQLEngine._execute() method, but not in
the _executemany method nor in the PGSQLEngine._executemany() method. Is
this intentional? I think it's not really useful, because I need to handle
*two* different exceptions *differently* at the very same point in the
code. If it's not possibile to wrap an exception every time it occurs, it
would be better to have it not wrapped at all.

Bye!


-- 
Alan Franzoni <[EMAIL PROTECTED]>
-
Togli .xyz dalla mia email per contattarmi.
To contact me, remove .xyz from my email address.
-
GPG Key Fingerprint:
5C77 9DC3 BD5B 3A28 E7BC 921A 0255 42AA FE06 8F3E

Attachment: test-saexc.py
Description: Attached file: test-saexc.py

Reply via email to