extension-port-stream icon indicating copy to clipboard operation
extension-port-stream copied to clipboard

fix: check runtime.lastError and turn into warnings

Open BelfordZ opened this issue 2 years ago • 1 comments

fixes https://github.com/MetaMask/metamask-extension/issues/14987

fixes #22

runtime.lastError needs to be checked when doing callback-based async things: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/lastError https://developer.chrome.com/docs/extensions/reference/runtime/

By just reading the value, the error message goes away. In the case of disconnect, lastError is set when there was an error disconnecting.

BelfordZ avatar Jun 30 '22 21:06 BelfordZ

Typically we don't use console in libraries, so that the parent project can better control what gets printed to their console.

Could we forward this error to the caller instead, letting it decide how to handle the error? That's what #22 is attempting to do I believe.

Gudahtt avatar May 01 '23 12:05 Gudahtt