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

fs: improve error messages #675

Merged
merged 1 commit into from
Jan 31, 2015
Merged

Conversation

piscisaureus
Copy link
Contributor

  • Include a description for the error message
  • For rename, link, and symlink, include both the source and destination
    path in the error message.
  • Expose the destination path as the dest property on the error object.

API impact:

  • The public node::UVException() function now takes 6 arguments.

This is an alternative for #293
R=@iojs/tc

@piscisaureus
Copy link
Contributor Author

}
Local<Object> e = Exception::Error(js_msg)->ToObject(isolate);

// TODO(piscisaureus) errorno should probably go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should errno go?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comment was already there. I believe the motivation for putting it there was that uv error codes are meaningless to the user, because there is no way to know what their values are.

@bnoordhuis bnoordhuis added the semver-minor PRs that contain new features and should be released in the next minor version. label Jan 31, 2015
@bnoordhuis
Copy link
Member

LGTM but see comment.

I tagged this semver-minor because the API (but not the ABI) is backwards/source compatible. NODE_MODULE_VERSION should be bumped.

@bnoordhuis
Copy link
Member

Come to think of it, you can probably make it ABI-compatible by having an overload instead of adding a new parameter.

@piscisaureus
Copy link
Contributor Author

Come to think of it, you can probably make it ABI-compatible by having an overload instead of adding a new parameter.

I was thinking the same, but I noticed how many overloaded error functions we already had... But ok, everything for a stable ABI I guess.

@piscisaureus
Copy link
Contributor Author

@bnoordhuis updated, ptal

* Include a description for the error message
* For rename, link, and symlink, include both the source and destination
  path in the error message.
* Expose the destination path as the `dest` property on the error object.
* Fix a bug where `ThrowUVException()` would incorrectly delegate to
  `Environment::TrowErrnoException()`.

API impact:
* Adds an extra overload for node::UVException() which takes 6
  arguments.

PR: nodejs#675
Fixes: nodejs#207
Closes: nodejs#293
Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
@bnoordhuis
Copy link
Member

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants