From d009caaf61c4a0ba2b58576fb5600541bae4b603 Mon Sep 17 00:00:00 2001 From: Gabriele Barni Date: Tue, 28 Jan 2025 13:40:30 +0100 Subject: [PATCH] Revert "no sentry, just logging, if backend execution fails" (#135) --- .../dataserver_dispatcher.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/dispatcher_plugin_nb2workflow/dataserver_dispatcher.py b/dispatcher_plugin_nb2workflow/dataserver_dispatcher.py index 724e2b1..9c54c00 100644 --- a/dispatcher_plugin_nb2workflow/dataserver_dispatcher.py +++ b/dispatcher_plugin_nb2workflow/dataserver_dispatcher.py @@ -183,6 +183,7 @@ def run_query(self, task = None, param_dict = None): + res = None message = '' debug_message = '' query_out = QueryOutput() @@ -207,19 +208,16 @@ def run_query(self, if res.status_code == 200: resroot = res.json()['data'] if run_asynch else res.json() - if resroot['exceptions']: + except_message = None + if resroot['exceptions']: if isinstance(resroot['exceptions'][0], dict): # in async except_message = resroot['exceptions'][0]['ename']+': '+res.json()['data']['exceptions'][0]['evalue'] else: except_message = res.json()['exceptions'][0] - - if resroot['exceptions'][0]['ename'] == 'AnalysisError': - query_out.set_status(1, message='Error in the backend', debug_message=except_message, job_status='failed') - else: - query_out.set_failed('Backend failed', - message='Backend failed. ' + except_message, - job_status='failed') - + + query_out.set_failed('Backend exception', + message='Backend failed. ' + except_message, + job_status='failed') return res, query_out comment_name = self.get_backend_comment(task.strip('/'))