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

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

9 statements  

1# 

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

3# See the NOTICE for more information. 

4 

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

6# BaseException and Exception classes because we also define 

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

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

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

10 

11 

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

13# at application level 

14class HaltServer(BaseException): 

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

16 self.reason = reason 

17 self.exit_status = exit_status 

18 

19 def __str__(self): 

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

21 

22 

23class ConfigError(Exception): 

24 """ Exception raised on config error """ 

25 

26 

27class AppImportError(Exception): 

28 """ Exception raised when loading an application """