From 44ac4e457f998ca761d79d244fab4d6d929f96d2 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 9 Oct 2015 07:48:18 +0900 Subject: [PATCH] inherit from Exception where it needs to be inherit from Exception where it needs to be and document why we use BaseException. fix #997 --- gunicorn/errors.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gunicorn/errors.py b/gunicorn/errors.py index 7465edb8..487d4380 100644 --- a/gunicorn/errors.py +++ b/gunicorn/errors.py @@ -4,6 +4,8 @@ # See the NOTICE for more information. +# we inherit from BaseException here to make sure to not be caucght +# at application level class HaltServer(BaseException): def __init__(self, reason, exit_status=1): self.reason = reason @@ -13,7 +15,7 @@ class HaltServer(BaseException): return "" % (self.reason, self.exit_status) -class ConfigError(BaseException): +class ConfigError(Exception): """ Exception raised on config error """