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

Implement custom error type #2

Open
7 tasks
Shadow53 opened this issue Mar 17, 2020 · 0 comments
Open
7 tasks

Implement custom error type #2

Shadow53 opened this issue Mar 17, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@Shadow53
Copy link
Member

  • Allows attaching an error message to an HTTP status code
  • Implements std::error::Error
  • Implements std::fmt::Display
    • Returns the actual error message
  • Implements warp::reject::Reject
  • Separate method for determining the error message to send back to client
    • If status >= 500, use a generic message rather than the actual error text
    • If status >= 400 && status < 500 use the actual error message

Note: May use an external library for this. I am considering implementing this as part of Nebula as its own crate that we can use here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant