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

Better error message for incorect parameters under Windows #1354

Merged
merged 1 commit into from
Oct 8, 2017

Conversation

gozzoo
Copy link
Contributor

@gozzoo gozzoo commented Oct 8, 2017

When opening a serial port with wrong parameters Windows returns:

Error: Open (SetCommState): Unknown error code 87

which is confusing and not very helpful. See #1353

With this fix users will get more meanigful message.

Error description comes from the Microsoft documentation:

ERROR_INVALID_PARAMETER
87 (0x57)
The parameter is incorrect.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx

Error message according the Microsoft documentation:

ERROR_INVALID_PARAMETER = 87 -> The parameter is incorrect.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx
@gozzoo gozzoo changed the title Fix for "Error while opening serial port under Windows" #1353 Fix for "Error: Open (SetCommState): Unknown error code 87" under Windows Oct 8, 2017
@gozzoo gozzoo changed the title Fix for "Error: Open (SetCommState): Unknown error code 87" under Windows Better error message for incorect parameters under Windows Oct 8, 2017
@codecov-io
Copy link

codecov-io commented Oct 8, 2017

Codecov Report

Merging #1354 into master will increase coverage by 0.14%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1354      +/-   ##
==========================================
+ Coverage   79.43%   79.58%   +0.14%     
==========================================
  Files          21       20       -1     
  Lines         919      862      -57     
  Branches      166      162       -4     
==========================================
- Hits          730      686      -44     
+ Misses        189      176      -13
Impacted Files Coverage Δ
lib/bindings/auto-detect.js 69.23% <0%> (-30.77%) ⬇️
lib/bindings/win32.js

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dffa9d5...f236f94. Read the comment docs.

@reconbot reconbot merged commit 4ff9c67 into serialport:master Oct 8, 2017
@reconbot
Copy link
Member

reconbot commented Oct 8, 2017

Perfect 👍

@gozzoo gozzoo deleted the patch-1 branch October 8, 2017 16:13
@lock lock bot locked and limited conversation to collaborators Apr 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants