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

Error handler middleware with error storage #1

Conversation

Fishrock123
Copy link

This is http-rs#549 rebased on top of http-rs/http-types#174 & http-rs#570.

Presently does not compile correctly, which makes me a bit concerned about the plan with those two PRs.

error: lifetime may not live long enough
  --> examples\error_handler_middleware.rs:12:33
   |
12 |           |err: &url::ParseError| async move {
   |  _______________-_______________-_^
   | |               |               |
   | |               |               return type of closure is impl std::future::Future
   | |               let's call the lifetime of this reference `'1`
13 | |             let mut response = Response::new(StatusCode::ImATeapot);
14 | |             response.set_body(err.to_string());
15 | |             Ok(response)
16 | |         },
   | |_________^ returning this value requires that `'1` must outlive `'2`

yoshuawuyts and others added 30 commits April 20, 2020 13:21
This removes the need to use the intermediate Service struct making it easier to use Tide's Server.
Now that Service is no longer a thing, we no longer need a submodule to contain it.
Since Server now implement HttpService we no longer need Server::into_http_service
Enable use of `?` in Endpoint
Mentions `async-std` and its `features = ["attributes"]` clearly.
and use it in the Redirect endpoint
Remove intermediate Service struct
This depends on http-rs#414

Add serve_dir method to Route

Update serve_dir.rs

Adjust methods so body can correctly be sent along

tweak static file serving

simplify internals

cargo fmt & fix tests

fix all tests

cargo fmt

Fix merge conflicts with master

undo bonus changes

Fix static path prefix stripping err
…-features-attributes

Documentation: Add "Getting Started" section to Readme and lib.rs.
Now supports both permanent and temporary redirects, and updated all vocabulary in Tide to be consistent with one another.
Introduces a new cookies submodule, and axes several unused types. Thanks!
yoshuawuyts and others added 26 commits June 1, 2020 14:35
Co-authored-by: Jeremiah Senkpiel <[email protected]>
Bring response in line with http-types
Signed-off-by: Marc-Antoine Perennou <[email protected]>
drop unused serde_qs dependency
When these were merged as re-enabled in
4034f33
they were broken due to being merged after
4276d67
because apparently cookie-0.14.1 uses a feature flag in docs
@Fishrock123
Copy link
Author

Fishrock123 commented Jun 8, 2020

Closing in favor of http-rs@a1cb10e on http-rs#570

@Fishrock123 Fishrock123 closed this Jun 8, 2020
jbr pushed a commit that referenced this pull request Feb 21, 2021
Update version numbers of deps
jbr pushed a commit that referenced this pull request Aug 10, 2021
change readme so the text isn't all wonky
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.