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.
This commit is contained in:
Ralph Bean
2017-01-31 12:37:50 -05:00
parent 370f3e79ae
commit 78bd24b62a

View File

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