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() session.flush()
except Exception as error: except Exception as error:
session.rollback() session.rollback()
log.exception("batch population failed: %s", batch) log.exception("population failed for batch %s: %s", batch.uuid, batch)
session.close() session.close()
if progress: if progress:
progress.session.load() progress.session.load()
progress.session['error'] = True progress.session['error'] = True
progress.session['error_msg'] = "Batch population failed: {}".format( progress.session['error_msg'] = simple_error(error)
simple_error(error))
progress.session.save() progress.session.save()
return return