From e1c43b0d70b1b39e7568e1d989585040b7837854 Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Wed, 17 Jul 2024 19:05:44 +0530 Subject: [PATCH] better js error logs --- functions/executor.js | 2 +- recipes/Functions.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/functions/executor.js b/functions/executor.js index be5ef10d0..884e29c2b 100644 --- a/functions/executor.js +++ b/functions/executor.js @@ -23,7 +23,7 @@ Deno.serve(async (req) => { status = 200; response = { retval }; } catch (e) { - status = 500; + status = 207; response = { error: toString(e), errorType: typeof e }; } diff --git a/recipes/Functions.py b/recipes/Functions.py index 5987a0235..9175326e3 100644 --- a/recipes/Functions.py +++ b/recipes/Functions.py @@ -71,10 +71,8 @@ def run_v2( raise_for_status(r) data = r.json() response.logs = data.get("logs") - if r.ok: - response.return_value = data.get("retval") - else: - response.error = data.get("error") + response.return_value = data.get("retval") + response.error = data.get("error") def render_form_v2(self): st.text_area(