Re: How to get the Exception Type

2012-05-15 Thread bruno desthuilliers
On May 15, 1:29 am, LJ wrote: > I am trying to add exception handling to my application. > I have been reading the documentation on Django > Exceptions:https://docs.djangoproject.com/en/dev/ref/exceptions/ > I also found the list of Exceptions (both Django and Python). > But

Re: How to get the Exception Type

2012-05-15 Thread bruno desthuilliers
On May 15, 2:31 am, Nikolas Stevenson-Molnar wrote: > You could also log the whole stack trace using the traceback > module:http://docs.python.org/library/traceback.html Or just use logging.exception, that takes care of all the gory details in a single and simple call:

Re: How to get the Exception Type

2012-05-14 Thread Nikolas Stevenson-Molnar
You could also log the whole stack trace using the traceback module: http://docs.python.org/library/traceback.html _Nik On 5/14/2012 4:54 PM, Luis Gonzalez wrote: > Hi as you can see here at http://docs.python.org/tutorial/errors.html > in 8.3 handling exceptions theres a piece of code that

Re: How to get the Exception Type

2012-05-14 Thread Luis Gonzalez
Hi as you can see here at http://docs.python.org/tutorial/errors.html in 8.3 handling exceptions theres a piece of code that works as you want. for example try this: try: int("a") except Exception as e: #The key is using "as" and the variable name you like for retrieving the exception because

How to get the Exception Type

2012-05-14 Thread LJ
I am trying to add exception handling to my application. I have been reading the documentation on Django Exceptions: https://docs.djangoproject.com/en/dev/ref/exceptions/ I also found the list of Exceptions (both Django and Python). But for testing purposes, I need a way to handle all exceptions