Albert Lukaszewski

Quotes

DDaudalagidhas quoted2 years ago
An exception is only explicitly registered when raise is used. Instead of the print statement used in the except clause previously, we can raise an error and update the print statement with the following line of code:
raise MySQLdb.Error
Instead of the friendly statement about an error passing, we get a stack trace that ends as follows:
_mysql_exceptions.Error
DDaudalagidhas quoted2 years ago
except MySQLdb.Error, e:
print "An error has been passed. %s" %e
DDaudalagidhas quoted2 years ago
For exceptions see:
http://python.about.com/od/pythonstandardlibrary/a/lib_exceptions.htm
For warnings visit:
http://python.about.com/od/pythonstandardlibrary/a/lib_warnings.htm
The Python documentation also covers them at:
http://docs.python.org/library/exceptions.html

References

fb2epub
Drag & drop your files (not more than 5 at once)