gunicorn/gunicorn/errors.py
Benoit Chesneau 44ac4e457f inherit from Exception where it needs to be
inherit from Exception where it needs to be and document why we use BaseException.

fix #997
2015-10-09 07:48:18 +09:00

24 lines
632 B
Python

# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# 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
self.exit_status = exit_status
def __str__(self):
return "<HaltServer %r %d>" % (self.reason, self.exit_status)
class ConfigError(Exception):
""" Exception raised on config error """
class AppImportError(Exception):
""" Exception raised when loading an application """