mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-11 17:14:59 +08:00
Log the original exception in consumer before trying to do anything else. Also commit the db.session before doing build.transition
This commit is contained in:
@@ -238,12 +238,14 @@ class MBSConsumer(fedmsg.consumers.FedmsgConsumer):
|
||||
try:
|
||||
further_work = handler(conf, session, msg) or []
|
||||
except Exception as e:
|
||||
if build:
|
||||
build.transition(conf, state=models.BUILD_STATES['failed'],
|
||||
state_reason=str(e))
|
||||
msg = 'Could not process message handler. See the traceback.'
|
||||
log.exception(msg)
|
||||
session.commit()
|
||||
session.rollback()
|
||||
if build:
|
||||
session.refresh(build)
|
||||
build.transition(conf, state=models.BUILD_STATES['failed'],
|
||||
state_reason=str(e))
|
||||
session.commit()
|
||||
|
||||
log.debug("Done with %s" % idx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user