Skip to content

Commit

Permalink
Display all the errors from the error interceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulyadav-57 committed May 28, 2024
1 parent 09aaa73 commit a401908
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/workspace/WorkSpace/WorkSpace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ const WorkSpace: FC = () => {
const interceptConsoleError = (e: any) => {
if (e?.detail?.data?.length === 0) return;
const _log = e.detail.data.join(', ');
// Some of the error aren't getting thrown by Tact compiler instead then are logged. So we need to check if the log contains '>' or 'compilation error'. This string is only present in the logs thrown by Tact compiler.
// Some of the error aren't getting thrown by Tact compiler instead then are logged.
// console.error is not getting intercepted by the workspace because they stores reference to the original console.error method. So I have created global script(public/assets/js/log.js) which is getting loaded before any other script and it listens to the console.error and dispatches an event with the error message.
if (!(_log.includes('>') || _log.includes('compilation error'))) return;

createLog(_log, 'error', true, true);
};
Expand Down

0 comments on commit a401908

Please sign in to comment.