Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/gunicorn/errors.py: 62%

8 statements  

« prev     ^ index     » next       coverage.py v7.3.1, created at 2023-09-25 06:32 +0000

1# -*- coding: utf-8 - 

2# 

3# This file is part of gunicorn released under the MIT license. 

4# See the NOTICE for more information. 

5 

6# We don't need to call super() in __init__ methods of our 

7# BaseException and Exception classes because we also define 

8# our own __str__ methods so there is no need to pass 'message' 

9# to the base class to get a meaningful output from 'str(exc)'. 

10# pylint: disable=super-init-not-called 

11 

12 

13# we inherit from BaseException here to make sure to not be caught 

14# at application level 

15class HaltServer(BaseException): 

16 def __init__(self, reason, exit_status=1): 

17 self.reason = reason 

18 self.exit_status = exit_status 

19 

20 def __str__(self): 

21 return "<HaltServer %r %d>" % (self.reason, self.exit_status) 

22 

23 

24class ConfigError(Exception): 

25 """ Exception raised on config error """ 

26 

27 

28class AppImportError(Exception): 

29 """ Exception raised when loading an application """