From f58b06531698737634b6247679b8c2309f6bea22 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 9 Feb 2021 14:24:05 -0600 Subject: [PATCH] Make errors more obvious, when running batch commands as subprocess admin still must consult logs to determine cause, but at least UI won't hang --- tailbone/views/batch/core.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index d178d60a..299f0a10 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -988,13 +988,14 @@ class BatchMasterView(MasterView): except Exception as error: log.warning("%s of '%s' batch failed: %s", handler_action, self.handler.batch_key, batch_uuid, exc_info=True) - # TODO: write error info to socket - - # if progress: - # progress.session.load() - # progress.session['error'] = True - # progress.session['error_msg'] = "Batch population failed: {} - {}".format(error.__class__.__name__, error) - # progress.session.save() + # TODO: write minimal error info to socket + if progress: + progress.session.load() + progress.session['error'] = True + progress.session['error_msg'] = ( + "{} of '{}' batch failed (see logs for more info)").format( + handler_action, self.handler.batch_key) + progress.session.save() return