raise on registering conflicting message handler

This commit is contained in:
Jan Pochyla 2016-06-09 16:33:19 +02:00 committed by Pavol Rusnak
parent 788eb675a5
commit 43e6bc2f11
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
1 changed files with 2 additions and 0 deletions

View File

@ -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