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

Throw argument errors during construction instead of passing them in a callback #820

Closed
reconbot opened this issue May 23, 2016 · 0 comments
Milestone

Comments

@reconbot
Copy link
Member

Right now options errors when creating a serialport happen in a callback that is called immediately if provided to the constructor or emitted on the factory object. Lets throw these errors immediately.

We won't need the factory after this which things even further.

I suggest we return the constructor, but keep a copy of it on a SerialPort property as to not confuse too many people with this change. (eg, most example code on the net will continue to work) which we can depreciate later. list and parsers will also need to be properties of the constructor function too.

@reconbot reconbot added this to the 4.0 milestone May 23, 2016
@reconbot reconbot changed the title Throw option errors during construction instead of passing them in a callback Throw argument errors during construction instead of passing them in a callback May 26, 2016
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant