On Thu, 2007-03-22 at 12:53 +0100, sebastien Pastor wrote: > Coming back to the topic. Will i be safe if i surround my SQL-related > code with mySQLDb exceptions? As i understood that doing some tests that > those are the exceptions raised by django. > > Can anyone confirm this ? Or point me to another directions to handle > SQL exceptions properly if there is some other way ?
In the near future (certainly prior to 1.0), we will wrap the more user-visible exceptions so that you can catch them without needing to refer to the specific database backend. At the moment, the exception you are mostly likely to see from a save() call is a database IntegrityError but you cannot catch it in a database-neutral way. There is a ticket open (#3450) to change that. I cannot think of cases when other database exceptions should be leaking out, although I'm not sure we can transparently handle "database server has gone away completely" types of errors, so we may need to wrap the base exception in the DB-API hierarchy as well for cases like that. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---