-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
fs: bad error message in fs.openSync #2871
Comments
console.log(require('fs').openSync('what.js', 'w')) |
but yea the error definitely says |
should we throw |
I think it should throw a In fact, I just realized that's already broken in |
I'll conjure up a PR to fix this. |
Before, it would show "TypeError: flags must be an int", which in native Node is technically correct. But in JS they may be (and usually are) strings. Fixes nodejs#2871
Fixed by #5590 |
Calling:
Throws:
TypeError: flags must be an int
from native land.While on the C++ side, that may be correct, in JavaScript land, the 2nd argument is not an int but a string.
In other words, yes, me passing an object was bad, but the error informed me to do the wrong thing compared to what the docs say.
The text was updated successfully, but these errors were encountered: