简体   繁体   中英

Exception Handling in Python for continuous execution

The question is related to Python:

Normally, I use except(RuntimeError) and use continue, so my code does not break while processing huge amounts of data.

However, it is harder for me to include all the types of errors that I encounter while running my code, since there are multiple possibilities. How do I just say - whatever happens - don't break but just continue, instead of including (RuntimeError, TypeError, ValueError and so on)

Have you tried using only except with no parameters?

try:

 code

except:

 continue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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