garrows/browser-serialport

align with with node-serialport errors

jacobrosenthal opened this issue · 5 comments

Until we get tests done, fixed the one string in https://github.com/garrows/browser-serialport/tree/returnerrors

Somewhat related, are we happy returning chrome.runtime.lastError. Is it actually an error object, or should we wrap it?

I tried some stuff in an extension but couldnt really verify..

typeof is object but both of these throw "TypeError: Expecting a function in instanceof check, but got Error"
console.log(chrome.runtime.lastError instanceof Error)
console.log(Error.prototype.isPrototypeOf(chrome.runtime.lastError)

Chrome errors should be actual error objects. There was 1 more string that should have been an error. Let me find it.

found and fixed in 40bb717

error strings removed. updating title

We throw a bunch more errors in our master branch right now (primarily around opening and closing ports). Just a heads up.