From 22676b0e79722f4c33dd6d39f2e8fcbb58679195 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 22 Mar 2024 14:48:49 +0100 Subject: [PATCH] perf: Parse only first line in exc for msg --- insights/insights/doctype/insights_data_source/sources/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/insights/insights/doctype/insights_data_source/sources/utils.py b/insights/insights/doctype/insights_data_source/sources/utils.py index a62588877..386efba27 100644 --- a/insights/insights/doctype/insights_data_source/sources/utils.py +++ b/insights/insights/doctype/insights_data_source/sources/utils.py @@ -311,7 +311,7 @@ def handle_query_execution_error(e): frappe.throw( "Syntax error in the query. Please check the browser console for more details." ) - frappe.throw(str(e).splitlines()[0]) + frappe.throw(str(e).split("\n", 1)[0]) def cache_results(sql, data_source, results):