-
Notifications
You must be signed in to change notification settings - Fork 327
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
Log err.message instead of <unavailable> err object #2939
Log err.message instead of <unavailable> err object #2939
Conversation
As an aside, I think it depends on which console you're looking at. There're three consoles; extension debugging, browser, and page. One of them is bound to actually provide access to the object. |
@Sxderp Yes, that's correct. I played around with exceptions, errors, etc., and there are quite a few occations, when you get a full output on the (tool) Maybe there is a case, where we would like to see the whole object (and it has a nice output), but for me, it looks as if I often miss a helpful error message, if an error occurs. Tell me, if there are really many cases (apart from debugging with break points and value evaluation), where you need the whole error object (in the case of |
Please help me understand/test: Clear reproduction case where the effect before this change is undesirable? |
I don't know, if I understood your question right, but here is my "problem" with the current output: Now and then, while testing, an unexpected error occurs. Reason: wrong data, a programming error, sth. weird. |
src/bg/user-script-registry.js
Outdated
@@ -105,8 +105,8 @@ async function installFromDownloader(userScriptDetails, downloaderDetails) { | |||
} | |||
return details.uuid; | |||
}).catch(err => { | |||
console.error('Error in installFromDownloader()', err); | |||
// Rethrow so caller can also deal with it | |||
console.error('Error in installFromDownloader():', err.message); |
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.
I could be wrong about this, but I don't think indexedDB errors are guaranteed to have a .message
property. Might want to force a ConstraintError (as an example) and see if it has a message. If it doesn't then this may need to be changed to err.message || err.name
.
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.
This could be a good idea for every such error message (except for chrome.runtime.lastError
).
Sorry I forgot about this for a while, now it won't merge cleanly. |
@arantius Thank you for all these recent fixes. Very nice. |
Most of the log messages printing a caught error object
err
(orchrome.runtime.lastError
) were converted to<unavailable>
, which is not very helpful. But thenerr.message
provides the information needed.