browser-serialport icon indicating copy to clipboard operation
browser-serialport copied to clipboard

align with with node-serialport errors

Open jacobrosenthal opened this issue 9 years ago • 5 comments

https://github.com/garrows/browser-serialport/blob/master/index.js#L190 need https://github.com/voodootikigod/node-serialport/issues/440

jacobrosenthal avatar Jan 15 '15 01:01 jacobrosenthal

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)

jacobrosenthal avatar Jan 15 '15 07:01 jacobrosenthal

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

phated avatar Jan 16 '15 20:01 phated

found and fixed in https://github.com/garrows/browser-serialport/commit/40bb717d5fe6fe7057e97c4baa82a4db52198191

phated avatar Jan 16 '15 20:01 phated

error strings removed. updating title

phated avatar Jan 17 '15 18:01 phated

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

reconbot avatar Apr 03 '16 23:04 reconbot