Exception type additions

This commit is contained in:
itdominator 2022-09-05 18:09:34 -05:00
parent e1c42d9839
commit f5567d2631
1 changed files with 6 additions and 2 deletions

View File

@ -7,6 +7,10 @@
class EventSystemPushException(Exception):
...
class EventSystem: class EventSystem:
""" Inheret IPCServerMixin. Create an pub/sub systems. """ """ Inheret IPCServerMixin. Create an pub/sub systems. """
@ -37,14 +41,14 @@ class EventSystem:
self._gui_events.append(event) self._gui_events.append(event)
return None return None
raise Exception("Invald event format! Please do: ['sender_id': str, method_target: method, (data,): any]") raise EventSystemPushException("Invald event format! Please do: ['sender_id': str, method_target: method, (data,): any]")
def push_module_event(self, event: list) -> None: def push_module_event(self, event: list) -> None:
if len(event) == 3: if len(event) == 3:
self._module_events.append(event) self._module_events.append(event)
return None return None
raise Exception("Invald event format! Please do: ['target_id': str, method_target: method, (data,): any]") raise EventSystemPushException("Invald event format! Please do: ['target_id': str, method_target: method, (data,): any]")
def read_gui_event(self) -> list: def read_gui_event(self) -> list:
return self._gui_events[0] if self._gui_events else None return self._gui_events[0] if self._gui_events else None