Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

bad error message "TypeError: Usage: Buffer.concat(list, [length])" #7766

Closed
tj opened this issue Jun 10, 2014 · 4 comments
Closed

bad error message "TypeError: Usage: Buffer.concat(list, [length])" #7766

tj opened this issue Jun 10, 2014 · 4 comments

Comments

@tj
Copy link

tj commented Jun 10, 2014

"array expected, passed " or something would be more obvious to assert that it's a type issue, something consistent throughout core for type issues would be nice. AFAIK no others use "Usage: ..."

@indutny
Copy link
Member

indutny commented Jun 12, 2014

Hm... I'd say that this is a bit questionable :) @tjfontaine thoughts?

@tj
Copy link
Author

tj commented Jun 12, 2014

not a huge deal but every little bit of polish helps. from that message it could be length that is an invalid type, or the list, but doesn't really state what's actually wrong

@trevnorris
Copy link

Extracting the exact <type> passed would be too difficult. Maybe "Expected Buffer" or some such.

chrisdickinson added a commit to chrisdickinson/node that referenced this issue Nov 14, 2014
this brings the error messaging in line with
other node TypeError messages.

fixes nodejs#7766.
misterdjules pushed a commit to misterdjules/node that referenced this issue Mar 3, 2015
this brings the error messaging in line with
other node TypeError messages.

fixes nodejs#7766.

PR: nodejs#8723
PR-URL: nodejs#8723
Reviewed-by: Trevor Norris <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@misterdjules
Copy link

Fixed in d01a900 for v0.10, and merged in v0.12 and master with b0425f0 and a995a6a. Thank you @chrisdickinson!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants