diff --git a/hl7apy/mllp.py b/hl7apy/mllp.py index ad54da0..7117423 100644 --- a/hl7apy/mllp.py +++ b/hl7apy/mllp.py @@ -95,7 +95,8 @@ def handle(self): if message is not None: try: response = self._route_message(message) - except Exception: + except Exception as exc: + self._handle_routing_error(exc, message) self.request.close() else: # encode the response @@ -138,6 +139,9 @@ def _create_handler(self, handler_class, msg, args): def _create_error_handler(self, handler_class, exc, msg, args): return handler_class(exc, msg, *args) + def _handle_routing_error(self, exc, msg): + pass + class MLLPServer(ThreadingTCPServer): """