X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fservice%2Fmessagebus.py;h=297aa8f1e1c324b22ec9ecc1a4f94b940f7aa6ce;hb=19ee63847f8eb032009e63634b90eb594f3c0408;hp=c1970f8c0dc48dfb2828c47a9aabb7e822ffa6a2;hpb=d4513e022d7d75d9967072cec1e0d7db34571120;p=pti%2Fo2.git diff --git a/o2ims/service/messagebus.py b/o2ims/service/messagebus.py index c1970f8..297aa8f 100644 --- a/o2ims/service/messagebus.py +++ b/o2ims/service/messagebus.py @@ -41,7 +41,9 @@ class MessageBus: self.queue = [message] while self.queue: message = self.queue.pop(0) - if isinstance(message, events.Event): + if not message: + continue + elif isinstance(message, events.Event): self.handle_event(message) elif isinstance(message, commands.Command): self.handle_command(message) @@ -65,6 +67,6 @@ class MessageBus: handler = self.command_handlers[type(command)] handler(command) self.queue.extend(self.uow.collect_new_events()) - except Exception: + except Exception as ex: logger.exception("Exception handling command %s", command) - raise + raise ex