diff --git a/maro/communication/message.py b/maro/communication/message.py index 59752692..6ae4cdc8 100644 --- a/maro/communication/message.py +++ b/maro/communication/message.py @@ -2,19 +2,12 @@ # Licensed under the MIT license. # native lib -import sys import uuid from enum import Enum from typing import Union -# private lib -from maro.utils import InternalLogger -from maro.utils.exit_code import NON_RESTART_EXIT_CODE - from .utils import session_id_generator -logger = InternalLogger(component_name="message") - class SessionType(Enum): """Communication session categories. @@ -113,5 +106,4 @@ class SessionMessage(Message): elif self.session_type == SessionType.NOTIFICATION: self.session_stage = session_stage if session_stage else NotificationSessionStage.REQUEST else: - logger.error(f"Receive unrecognized session type {self.session_type}, please use the SessionType class.") - sys.exit(NON_RESTART_EXIT_CODE) + raise KeyError(f'Unsupported session type {self.session_type}.')