Carrooi / Node-FsMock

[ABANDONED] Mock for fs module
MIT License
7 stars 2 forks source link

Thrown errors do not set error properties #12

Open eugirdor opened 9 years ago

eugirdor commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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