File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,16 @@ trapping ALL exceptions:
6262 # Some logging if you want
6363 raise e
6464
65- This can be helpful when you have no idea about the exceptions which may
66- be thrown by your program.
65+ This can be helpful when you have no idea about the exceptions that may
66+ be thrown by your program. If you are just looking to catch all execptions,
67+ but don't actually care about what they are, you can even exclude the
68+ ``Exception as e `` part.
69+
70+ Note:: catching all exceptions may have unintended consequences because catching
71+ all exceptions may also catch the ones you want to occur; for example, in
72+ many command-line based programs, pressing control+c will terminate the program,
73+ but if you catch all excepts, the ``KeyboardInterrupt `` will be caught as an
74+ exception, so pressing control+c will NOT terminate the program.
6775
6876``finally `` clause
6977~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments