-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement console.error interception and logging for Tact compiler er…
…rors
- Loading branch information
1 parent
8379ddc
commit c5f8f77
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Backup the original console.error function | ||
const originalConsoleError = console.error; | ||
|
||
// Override console.error | ||
console.error = function (...args) { | ||
logErrorToService(args); | ||
// Call the original console.error function with all the arguments | ||
originalConsoleError.apply(console, args); | ||
}; | ||
|
||
function logErrorToService(args) { | ||
const logEvent = new CustomEvent("consoleError", { | ||
detail: { data: args }, | ||
}); | ||
document.dispatchEvent(logEvent); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c5f8f77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolves #19