feat: improve error handling and reporting
This commit is contained in:
parent
dabc26f8a6
commit
f8d578e6aa
6 changed files with 101 additions and 42 deletions
|
|
@ -3,13 +3,20 @@ class ClientMessageType:
|
|||
REQUEST = "REQ"
|
||||
CLOSE = "CLOSE"
|
||||
|
||||
|
||||
class RelayMessageType:
|
||||
EVENT = "EVENT"
|
||||
NOTICE = "NOTICE"
|
||||
END_OF_STORED_EVENTS = "EOSE"
|
||||
COMMAND_RESULT = "OK"
|
||||
|
||||
@staticmethod
|
||||
def is_valid(type: str) -> bool:
|
||||
if type == RelayMessageType.EVENT or type == RelayMessageType.NOTICE or type == RelayMessageType.END_OF_STORED_EVENTS:
|
||||
if (
|
||||
type == RelayMessageType.EVENT
|
||||
or type == RelayMessageType.NOTICE
|
||||
or type == RelayMessageType.END_OF_STORED_EVENTS
|
||||
or type == RelayMessageType.COMMAND_RESULT
|
||||
):
|
||||
return True
|
||||
return False
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue