Catch Of Control Flow Exception (ARCH2168)
هذا المحتوى غير متوفر بلغتك بعد.
Key python.logging.catch-control-flow · Severity warning · Category logging
Catching framework/runtime exceptions like KeyboardInterrupt or SystemExit that should propagate breaks cancellation and shutdown behavior. These exceptions let the application stop cleanly.
Incorrect
Section titled “Incorrect”try: run_worker()except BaseException: logger.error("Worker stopped")Correct
Section titled “Correct”try: run_worker()except Exception: logger.exception("Worker error")Catch Exception rather than BaseException; let cancellation and shutdown exceptions propagate.