1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-12 18:49:07 +00:00

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

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