From d65276badc8e58735a91517d0224317c28cb97c5 Mon Sep 17 00:00:00 2001 From: Ritik Ranjan Date: Thu, 24 Oct 2024 20:27:02 +0530 Subject: [PATCH] if no error location is avaliable if no error location is avaliable gui does not show any error. It falls sliently --- src/components/EditorHeader/Modal/Modal.jsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/EditorHeader/Modal/Modal.jsx b/src/components/EditorHeader/Modal/Modal.jsx index 009b6892..c38a7d5e 100644 --- a/src/components/EditorHeader/Modal/Modal.jsx +++ b/src/components/EditorHeader/Modal/Modal.jsx @@ -148,17 +148,16 @@ export default function Modal({ database: database === DB.GENERIC ? importDb : database, }); } catch (err) { + let message = err.message; + if (err.location) { + message = err.name + " [Ln " + err.location.start.line + ", Col " + err.location.start.column + "]: " + err.message; + } + setError({ type: STATUS.ERROR, - message: - err.name + - " [Ln " + - err.location.start.line + - ", Col " + - err.location.start.column + - "]: " + - err.message, + message }); + return; }