Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Awesome RSS clutters up the Browser Console with uncaught errors #90

Closed
ssokolow opened this issue Jul 20, 2018 · 2 comments
Closed

Awesome RSS clutters up the Browser Console with uncaught errors #90

ssokolow opened this issue Jul 20, 2018 · 2 comments
Labels

Comments

@ssokolow
Copy link

Steps to reproduce

  1. Install Awesome RSS in a brand new Firefox profile
  2. Open the Browser Console (Ctrl+Shift+J)
  3. Reload this page

Expected behavior

The browser console should have the same number of error messages as before.

Actual behavior

Despite the extension appearing to function perfectly well, multiple errors of the form "Error: Could not establish connection. Receiving end does not exist." are logged to the console, originating at line 139, column 2 of the extension's js/background.js.

This spurious clutter makes it more difficult for me to do my own development and debugging. (Especially when they're interleaved from other similar spurious messages from other extensions, so they can't be collapsed as shown in the screenshot.)

Screenshots and/or logs (see how to open the developer console in your browser)

screenshot9

@shgysk8zer0
Copy link
Owner

@ssokolow I'll look into the error that's reported in the console, but I kinda need to log errors for reporting issues and development. Do you have any suggestions on how to resolve this without causing me to lose access to this essential information?

I'm also curious of your reason for working in the browser console on a new profile with this particular add-on installed.

@ssokolow
Copy link
Author

ssokolow commented Aug 3, 2018

I'll look into the error that's reported in the console, but I kinda need to log errors for reporting issues and development. Do you have any suggestions on how to resolve this without causing me to lose access to this essential information?

Call .catch(error_callback) on the promise returned by browser.tabs.sendMessage and you should be able to override the default error-handling behaviour. (Relevant MDN page)

Here's my recommendation for messages which occur as part of normal operation:

  1. Emit the caught error using console.log rather than the default console.error, so such a "normally expected error" can be filtered out easily using the browser console's filtering controls. (If you're familiar with other logging APIs, console.log() is equivalent to the DEBUG log level and Chrom .)
  2. If you don't customize it entirely, at least prefix it with something like Awesome RSS: so it's easy to see which extension it's coming from. (I had to click the js/background.js and then identify the extension by figuring out what the displayed source code was doing.)
  3. Hide the message behind a default-off "Enable debug logging" checkbox in your addon options page.

I'm also curious of your reason for working in the browser console on a new profile with this particular add-on installed.

I installed it in a fresh profile to verify that I had clean instructions for reproducing the problem and took the screenshot while I was at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants