Sunday, 23 January 2022

How to stop PyCharm's break/stop/halt feature on handled exceptions (i.e. only break on python unhandled exceptions)?

I have that PyCharm is halting on all my exceptions, even the ones I am handling in a try except block. I do not want it to break there - I am handling and perhaps expecting an error. But every other exception I do want it to halt and suspend execution (e.g. so that I have the program state and debug it).

How does one do that?

I tried going into the python exception breakpoint option but I didn't see an option like "break only on unhandled exceptions" e.g as suggested by these:

note this is my current state, note how it stopped in my try block... :(

crossposted: https://intellij-support.jetbrains.com/hc/en-us/community/posts/4415666598546-How-to-stop-PyCharm-s-break-stop-halt-feature-on-handled-exceptions-i-e-only-break-on-python-unhandled-exceptions-

enter image description here


I tried:

In your link here intellij-support.jetbrains.com/hc/en-us/community/posts/… the poster Okke said they solved this issue adding --pdb to the 'addition arguments', which someone later said they probably meant interpreter options.

but didn't work got error:

/Users/brandomiranda/opt/anaconda3/envs/meta_learning/bin/python --pdb /Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py --cmd-line --multiproc --qt-support=auto --client 127.0.0.1 --port 58378 --file /Users/brandomiranda/ultimate-utils/tutorials_for_myself/try_catch_pycharm_issues/try_catch_with_pickle.py
unknown option --pdb
usage: /Users/brandomiranda/opt/anaconda3/envs/meta_learning/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

Process finished with exit code 2


from How to stop PyCharm's break/stop/halt feature on handled exceptions (i.e. only break on python unhandled exceptions)?

No comments:

Post a Comment