打破pycharm中未处理的异常 [英] Break on unhandled exception in pycharm

查看:729
本文介绍了打破pycharm中未处理的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何处理pycharm中未处理的异常吗?每:

lockquote

创建一个异常断点


  1. 在主菜单上,选择运行|查看断点或按
    Ctrl + Shift + F8。
  2. 选择异常断点标签。

  3. 单击添加按钮。 >
  4. 在输入异常类对话框中,从库或
    项目指定所需的异常
    类,然后单击确定。



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?

解决方案

Please check the documentation:

To create an exception breakpoint

  1. On the main menu, choose Run | View Breakpoints, or press Ctrl+Shift+F8.
  2. Select the Exception Breakpoints tab.
  3. Click Add button.
  4. In the Enter Exception Class dialog, specify the desired exception class from the library, or from the project, and click OK.

这篇关于打破pycharm中未处理的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆