This project has moved and is read-only. For the latest updates, please go here.

error handling

Mar 21, 2013 at 4:57 PM
When a running python application in debug mode encounters an error, only sometimes PTVS will display a popup window at the location of the error. Most of the time it just dumps the error trace to the console without PTVS taking any notice of it. Can anyone tell me why or how to solve it? This is PTVS 2.0 alpha but iirc I encountered the same problem with the stable 1.5 release.
Mar 21, 2013 at 5:06 PM
Sorry, just realised this is partly a duplicate of

I cannot however find the options where to enable/disable breaking for individual exceptions/error and would be happy for any advise.
Mar 21, 2013 at 5:14 PM
You can configure the options in Debug->Exceptions and Tools->Options->Debugging->Enable Just my Code. Turning off just my code will cause the Debug->Exceptions window to only have the Thrown column. Or you can just expand "Python Exceptions" in Debug->Exceptions and make sure the Thrown column is checked for all exceptions.
Mar 21, 2013 at 5:15 PM
The options are under Debug->Exceptions and then Python Exceptions. I'd guess that the exceptions we're not breaking for are things like AttributeError and IndexError, where we cannot accurately determine whether there is an exception handler or not (because __getattr__ and for loops act as exception handlers for these). If you select the User-unhandled checkbox for these exceptions then we'll break, and if you enable the Thrown checkbox for any exception we'll break without trying to see if there's a handler or not. (In a lot of Python code, this will happen often. It's really meant for targeted use when you know that there's a particular exception you want to break at.)

If you only see one column of checkboxes then you should go to Debug->Options and Settings and check Enable Just My Code. In 2.0 alpha we don't properly handle the case when this option is disabled -
Mar 21, 2013 at 5:23 PM
Great, thanks a lot, that solved my problem. Awesome tool, keep it up!