Does anyone know how to break on unhandled exceptions in pycharm? per this link it should be possible, although its not breaking for me (build 105.58). Is there some switch I have to turn on to enable this?
EDIT: I did what you suggested, but the debugger is not breaking on unhandled exceptions. Please see the screenshot below, and let me know if I need to do something else.
It seems this is the same issue as breaking on unhandled exceptions in pydev/gae. Pycharm uses pydevd for the debugger.
C:\Python25\python.exe "C:\Program Files\JetBrains\PyCharm 1.2.1\helpers\pydev\pydevd.py" --client 127.0.0.1 --port 49371 --file C:/Users/morpheus/PycharmProjects/untitled1/main.py pydev debugger: warning: psyco not available for speedups (the debugger will still work correctly, but a bit slower) pydev debugger: starting Connected to pydev debugger (build 105.58)
I can get it to break on a non-gae project, but it won't break on a gae project. How can this be fixed?
Python breakpoint() - Stop Debugging Python sys. breakpointhook() function uses environment variable PYTHONBREAKPOINT to configure the debugger. If unset, the default PDB debugger is used. If it's set to “0” then the function returns immediately and no code debugging is performed.
An unhandled exception displays an error message and the program suddenly crashes. To avoid such a scenario, there are two methods to handle Python exceptions: Try – This method catches the exceptions raised by the program. Raise – Triggers an exception manually using custom exceptions.
Please check the documentation:
To create an exception breakpoint
- On the main menu, choose Run | View Breakpoints, or press Ctrl+Shift+F8.
- Select the Exception Breakpoints tab.
- Click Add button.
- In the Enter Exception Class dialog, specify the desired exception class from the library, or from the project, and click OK.
Now on Pycharm 5(at least) you can make it break on unhandled exceptions by checking "all exception" and "on terminate".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With