Skip to content

Commit

Permalink
Merge pull request #273 from rritik772/fix/no-error-location
Browse files Browse the repository at this point in the history
Fix parser silently failing when there is no error location
  • Loading branch information
1ilit authored Oct 25, 2024
2 parents b03b785 + d65276b commit fc936b9
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 fc936b9

Please sign in to comment.