From 5fff00338a258472f5c86f5c6f09ca56cf2b6022 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 11 Jun 2025 14:19:16 +0530 Subject: [PATCH] fix: added throwError global method (cherry picked from commit 9af300bba8a59cb49ecce26fe5e790fdb646cd99) --- frontend/src/data/script.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/data/script.js b/frontend/src/data/script.js index b809f744..47185bab 100644 --- a/frontend/src/data/script.js +++ b/frontend/src/data/script.js @@ -46,6 +46,11 @@ export function getScript(doctype, view = 'Form') { helpers.router = router helpers.call = call + helpers.throwError = (message) => { + toast.error(message || __('An error occurred')) + throw new Error(message || __('An error occurred')) + } + helpers.crm = { makePhoneCall: makeCall, }