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

Thrown errors do not set error properties #12

Open
eugirdor opened this issue Jun 11, 2015 · 2 comments
Open

Thrown errors do not set error properties #12

eugirdor opened this issue Jun 11, 2015 · 2 comments

Comments

@eugirdor
Copy link
Contributor

Errors thrown from the standard fs module have properties set on them such as code, errno, syscall, etc. These properties are no set on the errors thrown by fs-mock. This causes an issue since it is very common for code to branch based on the error code.

@davidkudera
Copy link
Member

Hi, I know that my error messages are really bad and definitely not compatible with standard fs. Do you please know about some documentation or something like that where these errors are described?

@eugirdor
Copy link
Contributor Author

Not sure about specific documentation. I think those errors just get bubbled up from libuv.

This looks to be where it constructs the actual Error object https://github.com/joyent/node/blob/master/lib/util.js#L741-L753. You can see what properties it sets there.

You can see the error codes here http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html

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

2 participants