Thanks Diez I'll have a look that way. What's strange is that in the
past I've been able to handle database error with this technique,
while using Sqlobject as orm :

IntegrityError =model.hub.getConnection
()._dbConnection.module.IntegrityError
ProgrammingError =model.hub.getConnection
()._dbConnection.module.ProgrammingError
from sqlobject import SQLObjectNotFound
from sqlobject.dberrors import DuplicateEntryError

catch_excep_expr="isinstance(tg_exceptions,
(KeyError,SQLObjectNotFound,DuplicateEntryError,IntegrityError,ValueError,ProgrammingError))"

And it worked with no trouble, I wonder what makes it different with
sqlalchemy...

If anyone has another idea about this, or technique to handle
application-wide db errors, I'll be glad to read about it!

Adrien

On 28 jan, 17:57, "Diez B. Roggisch" <[email protected]> wrote:
> > Would anyone know how to find a solution for this problem, or maybe
> > another technique for catching application-wide database exceptions?
>
> I'm sorry, I didn't catch the sentence that you already imported the exception
> in the first post.
>
> I don't know what to do else, except from making some nasty hack like
>
>   "SQLAlchemyError" in tg_exceptions.__class__.__name__
>
> which is of course ugly because it doesn't work for sub-classes.
>
> Other than that, I'd try to find more information about peak rules.
>
> Diez

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to