Uh oh!
There was an error while loading. Please reload this page.
Clarify Buffer hex string error message - #4877
Conversation
bnoordhuis
commented
Jan 26, 2016
I don't think we have a regression test for this. Can you add one to Apropos the commit log, can you make sure it conforms to the guidelines from CONTRIBUTING.md? Thanks. |
There was a problem hiding this comment.
Perhaps, "The hex string length must be an even number" or "The hex string must have an even number of characters"
jasnell
commented
Jan 27, 2016
Marking |
jgeewax
commented
Jan 28, 2016
@bnoordhuis I added a simple test that looks for the TypeError and (new) message. |
cjihrig
commented
Jan 28, 2016
Can you run |
There was a problem hiding this comment.
@bnoordhuis does our C++ style allow strings split like this (the linter doesn't complain)?
jgeewax
commented
Jan 28, 2016
@cjihrig Did a |
cjihrig
commented
Jan 28, 2016
The commit message should be LGTM, but maybe @trevnorris wants to sign off on this? |
cjihrig
commented
Jan 28, 2016
jgeewax
commented
Jan 28, 2016
@cjihrig : Fixed. I was going off the commit log, which seemed to have both. Sorry about that. |
cjihrig
commented
Jan 28, 2016
Looks like a commit just landed that conflicts with this one. Mind rebasing? |
jgeewax
commented
Jan 28, 2016
No problem. Let me know if that works for you. |
trevnorris
commented
Jan 30, 2016
Is this the only location we throw for incorrect hex string length? If so then LGTM. |
There was a problem hiding this comment.
minor nit: /^The hex string must have an even number of characters/.test(err.message)
|
jasnell
commented
Mar 22, 2016
@jgeewax ... ping. There were a few nits that need to be looked at. |
be3d46b to
df3fe4fComparejgeewax
commented
Mar 27, 2016
OK -- Addressed the console.log stuff as well as the nit for regex checking vs equality. |
|
There was a problem hiding this comment.
minor nit: can you update this to use Buffer.from('8', 'hex')
Taking a clue from https://github.com/nodejs/node/blob/master/src/string_bytes.cc#L503, provide more reason for why a hex string is invalid (namely that the issue is the length being odd rather than even).