diff --git a/gunicorn/workers/base_async.py b/gunicorn/workers/base_async.py index b059a7cb..6a79d7ed 100644 --- a/gunicorn/workers/base_async.py +++ b/gunicorn/workers/base_async.py @@ -82,7 +82,7 @@ class AsyncWorker(base.Worker): self.log.debug("Ignoring socket not connected") else: self.log.debug("Ignoring EPIPE") - except Exception as e: + except BaseException as e: self.handle_error(req, client, addr, e) finally: util.close(client) diff --git a/gunicorn/workers/sync.py b/gunicorn/workers/sync.py index 39a209f0..ddcd7727 100644 --- a/gunicorn/workers/sync.py +++ b/gunicorn/workers/sync.py @@ -154,7 +154,7 @@ class SyncWorker(base.Worker): self.log.debug("Ignoring socket not connected") else: self.log.debug("Ignoring EPIPE") - except Exception as e: + except BaseException as e: self.handle_error(req, client, addr, e) finally: util.close(client)