I am developing a Django site and have been having trouble trying to work out the best way to do exception handling. I have been doing
try:
Some code
except:
log error in my own words, i.e 'Some code' failed to execute
Some other code
This catches all exceptions thus ensuring my site does not deliver 500 errors and such like. But, with my limited knowledge I am losing the actual exception and it is making it a real pain to debug. How do I print the error that occured? Currently I comment out try: catch: and see the error and fix it. There must be a better way!
Thanks in advance
Rich
exceptstatement like that? Can you provide a quote or a link to a tutorial which shows this kind of programming? It's considered to be a bad practice. I want to know where you learned this.