MySQL Error

Victor Subervi victorsubervi at gmail.com
Fri Jan 1 11:52:17 EST 2010


Hi;
I'm trying to avoid the mortal sin of blank excepts. I intentionally threw
this error:

Traceback (most recent call last):
  File "/var/www/html/angrynates.com/cart/createAssociations2.py", line 137,
in ?
    createAssociations2()
  File "/var/www/html/angrynates.com/cart/createAssociations2.py", line 108,
in createAssociations2
    cursor.execute(sql)
  File "/usr/lib64/python2.4/site-packages/MySQLdb/cursors.py", line 163, in
execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.4/site-packages/MySQLdb/connections.py", line 35,
in defaulterrorhandler
    raise errorclass, errorvalue
ProgrammingError: (1146, "Table 'test.productsAssociations' doesn't exist")

However, "ProgrammingError" is not an error. How do I discover the real
error, so I can write the appropriate except statement?
TIA,
beno

-- 
The Logos has come to bear
http://logos.13gems.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100101/75257ee1/attachment.html>


More information about the Python-list mailing list