Skip to content

Better error message for incorect parameters under Windows - #1354

Merged
reconbot merged 1 commit into
serialport:masterfrom
gozzoo:patch-1
Oct 8, 2017
Merged

Better error message for incorect parameters under Windows#1354
reconbot merged 1 commit into
serialport:masterfrom
gozzoo:patch-1

Conversation

@gozzoo

@gozzoo gozzoo commented Oct 8, 2017

Copy link
Copy Markdown
Contributor

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

codecov-io commented Oct 8, 2017

Copy link
Copy Markdown

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

reconbot commented Oct 8, 2017

Copy link
Copy Markdown
Member

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