Skip to content

Commit d65276b

Browse files
author
Ritik Ranjan
committed
if no error location is avaliable
if no error location is avaliable gui does not show any error. It falls sliently
1 parent b03b785 commit d65276b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/components/EditorHeader/Modal/Modal.jsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,16 @@ export default function Modal({
148148
database: database === DB.GENERIC ? importDb : database,
149149
});
150150
} catch (err) {
151+
let message = err.message;
152+
if (err.location) {
153+
message = err.name + " [Ln " + err.location.start.line + ", Col " + err.location.start.column + "]: " + err.message;
154+
}
155+
151156
setError({
152157
type: STATUS.ERROR,
153-
message:
154-
err.name +
155-
" [Ln " +
156-
err.location.start.line +
157-
", Col " +
158-
err.location.start.column +
159-
"]: " +
160-
err.message,
158+
message
161159
});
160+
162161
return;
163162
}
164163

0 commit comments

Comments
 (0)