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

pub use ResultDynErrExt in tide::error #253

Merged
merged 1 commit into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use core::pin::Pin;
use futures::future::Future;

pub use tide_core::error::{EndpointResult, Error, ResponseExt, ResultExt, StringError};
pub use tide_core::error::{
EndpointResult, Error, ResponseExt, ResultDynErrExt, ResultExt, StringError,
};

pub(crate) type BoxTryFuture<T> = Pin<Box<dyn Future<Output = EndpointResult<T>> + Send + 'static>>;
6 changes: 2 additions & 4 deletions tide-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ pub trait ResultExt<T>: Sized {
self.with_err_status(500)
}

/// Convert to an `EndpointResult`, wrapping the `Err` case with a custom
/// response status.
/// Convert to an `EndpointResult`, wrapping the `Err` case with a custom response status.
fn with_err_status<S>(self, status: S) -> EndpointResult<T>
where
StatusCode: HttpTryFrom<S>;
Expand Down Expand Up @@ -111,8 +110,7 @@ pub trait ResultDynErrExt<T>: Sized {
self.with_err_status(500)
}

/// Convert to an `EndpointResult`, wrapping the `Err` case with a custom
/// response status.
/// Convert to an `EndpointResult`, wrapping the `Err` case with a custom response status.
fn with_err_status<S>(self, status: S) -> EndpointResult<T>
where
StatusCode: HttpTryFrom<S>;
Expand Down