Skip to content

Commit

Permalink
if no error location is avaliable
Browse files Browse the repository at this point in the history
if no error location is avaliable gui does not show any error. It falls
sliently
  • Loading branch information
Ritik Ranjan committed Oct 24, 2024
1 parent b03b785 commit d65276b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/components/EditorHeader/Modal/Modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d65276b

Please sign in to comment.