Errors in Chrome Extension Message Handlers not Logged
See original GitHub issuePackage + Version
-
@sentry/browser
Version:
5.5.0
Description
I am using Sentry to instrument a Chrome Extension. For the most part this works well.
However, uncaught errors in listeners registered via:
chrome.runtime.onMessage.addListener
are surprisingly not logged by sentry.
Note that uncaught errors in these handlers have a slightly different form when printed to the console. A normal uncaught error might log like this:
Uncaught TypeError: XYZ
While errors in the onMessage handler log something like:
Error in event handler: TypeError: XYZ
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Why does Chrome onerror handler not return full error ...
@Ivar yes, chrome's error handling does show the full message, but the problem is that the custom onerror handler's message is not the...
Read more >chrome.scripting - Chrome Developers
Use the chrome.scripting API to execute script in different contexts. Permissions ... An object to filter the extension's dynamically registered scripts.
Read more >Set Chrome policies for users or browsers - Google Support
Enrolled browsers to enforce policies when users open Chrome browser on managed Microsoft Windows, Apple Mac, or Linux computers. Signing in is not...
Read more >Extension errors should trigger the global onerror event.
Currently, many extension errors (chrome/renderer/resources/extensions/*.js) are just logged by calling console.error. In addition to printing the error to ...
Read more >Manifest V3 service worker registration failed - Google Groups
I cannot think of what else to do and the error message does not give any ... on the chrome://extensions page, then I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@scottfr async messages are not bubbling up to the main
onerror
listener, as they are meant to be used in communication between channels.Your best bet here (which works just fine, tested it locally) is to use
Sentry.wrap
OK, sounds good. Thanks for looking into this.