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

improve string error message #13

Closed
dougwilson opened this issue May 11, 2014 · 4 comments
Closed

improve string error message #13

dougwilson opened this issue May 11, 2014 · 4 comments

Comments

@dougwilson
Copy link
Contributor

It would be nice if the error message for an unknown parse would be nicer. Currently it is a bit confusing, I think:

$ node -pe 'require("bytes")("56r")'

node_modules\bytes\index.js:13
    , n = parseFloat(parts[1])
                          ^
TypeError: Cannot read property '1' of null
    at module.exports (node_modules\bytes\index.js:13:27)
    at [eval]:1:17
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:532:25)
    at startup (node.js:80:7)
    at node.js:902:3
@theofidry
Copy link
Contributor

Fixed in my fork https://github.com/theofidry/bytes.js, waiting for merge.

@dougwilson
Copy link
Contributor Author

@tj do you feel like added me to the npm module :)?

@theofidry
Copy link
Contributor

Hm after some thoughts I'm still changing a few things. It will be up in an hour I think.

@theofidry theofidry mentioned this issue Mar 16, 2015
@theofidry
Copy link
Contributor

@tj @dougwilson Ok it should be good, cf PR #20. Should not cause any backward incompatibility.

@tj tj closed this as completed Apr 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants