Tweak flash msg, logging when batch population fails

This commit is contained in:
Lance Edgar 2022-08-09 15:05:03 -05:00
parent 8f1f8abf42
commit 5952df82ff

View file

@ -1060,13 +1060,12 @@ class BatchMasterView(MasterView):
session.flush()
except Exception as error:
session.rollback()
log.exception("batch population failed: %s", batch)
log.exception("population failed for batch %s: %s", batch.uuid, batch)
session.close()
if progress:
progress.session.load()
progress.session['error'] = True
progress.session['error_msg'] = "Batch population failed: {}".format(
simple_error(error))
progress.session['error_msg'] = simple_error(error)
progress.session.save()
return