raise on registering conflicting message handler
This commit is contained in:
parent
788eb675a5
commit
43e6bc2f11
|
@ -6,6 +6,8 @@ message_handlers = {}
|
|||
|
||||
|
||||
def register(mtype, handler):
|
||||
if mtype in message_handlers:
|
||||
raise Exception('Message wire type %s is already registered', mtype)
|
||||
message_handlers[mtype] = handler
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue