From 78bd24b62a33bb0cdf4337f6ef350b5a33f77ed1 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Tue, 31 Jan 2017 12:37:50 -0500 Subject: [PATCH] Be careful with attribute access here. I hit a traceback where msg was NoneType and therefore didn't have a `msg_id` attribute, I therefore wasn't able to see the real exception that got me there in the first place. --- module_build_service/scheduler/consumer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module_build_service/scheduler/consumer.py b/module_build_service/scheduler/consumer.py index 9d206d22..1f6b01d6 100644 --- a/module_build_service/scheduler/consumer.py +++ b/module_build_service/scheduler/consumer.py @@ -126,8 +126,7 @@ class MBSConsumer(fedmsg.consumers.FedmsgConsumer): with models.make_session(conf) as session: self.process_message(session, msg) except Exception: - log.exception('Failed while handling {0!r}'.format(msg.msg_id)) - log.info(msg) + log.exception('Failed while handling {0!r}'.format(msg)) if self.stop_condition and self.stop_condition(message): self.shutdown()