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

Make it possible to construct errors with custom description #641

Closed
wants to merge 1 commit into from

Conversation

vks
Copy link
Contributor

@vks vks commented Aug 29, 2016

This is useful if a more meaningful message can be displayed to the
user with Error::exit. For example, if a file is not found, the
converted io::Error will give a message like:

"error: entity not found"

With this, it is possible to replace this message with a more useful
one, like for instance:

"error: configuration file not found"

Coloring is respected. Some duplication in the From::from impls was
reduced.

@yo-bot
Copy link

yo-bot commented Aug 29, 2016

Thanks for the pull request, and welcome! The team is excited to review your changes, and you should hear from @sru (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@sru
Copy link
Contributor

sru commented Aug 30, 2016

Please see the contribution instructions for more information.

More specifically, can you change the commit message to follow the format on the link above?

@kbknapp The link in the automatic bot message is pointing to CONTRIBUTING.md in the repo root directory, which is dead link now (it is moved to .github/CONTRIBUTING.md).

@vks
Copy link
Contributor Author

vks commented Aug 30, 2016

More specifically, can you change the commit message to follow the format on the link above?

Sure, I'll rebase after review.

@kbknapp
Copy link
Member

kbknapp commented Aug 30, 2016

Looks good to me! Thanks for this! @sru I'll change that link, thanks for pointing it out.

@vks once you rebase I'll merge 👍

This is useful if a more meaningful message can be displayed to the
user with `Error::exit`. For example, if a file is not found, the
converted `io::Error` will give a message like:

    "error: entity not found"

With this, it is possible to replace this message with a more useful
one, like for instance:

    "error: configuration file not found"

Coloring is respected. Some duplication in the `From::from` impls was
reduced.
@vks
Copy link
Contributor Author

vks commented Aug 30, 2016

Rebased with a reformatted commit message and slightly extended documentation.

@kbknapp
Copy link
Member

kbknapp commented Sep 5, 2016

@vks since #639 just merged, can you rebase one last time, and I'll merge this today.

Thanks!

@kbknapp
Copy link
Member

kbknapp commented Sep 5, 2016

Rebased and updated term_size dep in #646

@kbknapp kbknapp closed this Sep 5, 2016
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

Successfully merging this pull request may close these issues.

4 participants