From: Oleg B. <ph...@ph...> - 2013-09-12 20:12:47
|
On Thu, Sep 12, 2013 at 04:43:09PM -0300, Francisco Chiotta <fra...@gm...> wrote: > Ok, I thought that It was possible to recover an error code or something > like that. psycopg2 provides some information: http://initd.org/psycopg/docs/module.html#exceptions http://initd.org/psycopg/docs/errorcodes.html#module-psycopg2.errorcodes but SQLObject loose that information when it converts psycopg2's exceptions to SQLObject's exceptions. I can try to extract that information but only for SQLObject 1.5 (which is currently in pre-release state) and only for Postgres/psycopg2 (PySQLite doesn't return error codes, only strings; exceptions from MySQL already provide error code in e.code attribute). Do you want me to provide e.code for psycopg2? I'll ask you to test the result. Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |