|
@ -24,9 +24,9 @@ class ErrorHandler: |
|
|
def __enter__(self): |
|
|
def __enter__(self): |
|
|
return self |
|
|
return self |
|
|
|
|
|
|
|
|
def __exit__(self, typ, *_): |
|
|
def __exit__(self, typ, value, _): |
|
|
"""Checks for connection errors and exits respectively.""" |
|
|
"""Checks for connection errors and exits respectively.""" |
|
|
for error, message, returncode in self.errors: |
|
|
for error, message, returncode in self.errors: |
|
|
if isinstance(typ, error): |
|
|
if typ is error or isinstance(value, error): |
|
|
self.logger.error(message) |
|
|
self.logger.error(message) |
|
|
exit(returncode) |
|
|
exit(returncode) |
|
|