简体   繁体   English

在try / except中引发异常并继续

[英]raise the exception in a try/except and continue

so basically I have a loop and for each step, I run a function in a try/except. 所以基本上我有一个循环,对于每个步骤,我都在try / except中运行一个函数。 When there is an error caught, I have a generic error message that doesn't allow me to understand what went wrong. 当发现错误时,我会收到一条通用错误消息,该消息使我无法理解出了什么问题。

How do I have the real python built-in error message (raise) and still continue to run the loop? 如何获得真正的python内置错误消息(提升),并且仍然继续运行循环?

Thanks. 谢谢。

Sample code: 样例代码:

for i in [...]:
    try:
        func1(i)
    except Exception as ex:
        print(ex)
        func2(i)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM