diff options
Diffstat (limited to 'src/ogRest.py')
-rw-r--r-- | src/ogRest.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ogRest.py b/src/ogRest.py index c7bdcdb..5d6c746 100644 --- a/src/ogRest.py +++ b/src/ogRest.py @@ -19,6 +19,7 @@ import logging from logging.handlers import SysLogHandler from src.restRequest import * +from src.log import OgError class ThreadState(Enum): @@ -263,13 +264,13 @@ class ogRest(): from src.windows.ogOperations import OgWindowsOperations self.operations = OgWindowsOperations() else: - raise ValueError(f'Ogrest mode \'{self.mode}\'not supported') + raise OgError(f'Ogrest mode \'{self.mode}\'not supported') def send_internal_server_error(self, client, exc=None): - if isinstance(exc, AssertionError): - logging.exception(exc) - else: + if isinstance(exc, OgError): logging.error(exc) + else: + logging.exception(exc) response = restResponse(ogResponses.INTERNAL_ERR, seq=client.seq) client.send(response.get()) self.state = ThreadState.IDLE |