Skip to content

Commit

Permalink
refactor: replace anyhow error to box dyn stderror
Browse files Browse the repository at this point in the history
  • Loading branch information
ihciah committed Sep 20, 2023
1 parent 2d2e14d commit 2b6f5b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions monolake-core/src/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ use service_async::Service;

use crate::sealed::SealedT;

pub type HttpError = anyhow::Error;

// Response and a bool indicating should continue processing the connection.
// Service does not need to add `Connection: close` itself.
pub type ResponseWithContinue = (Response<HttpBody>, bool);
Expand Down
9 changes: 5 additions & 4 deletions monolake-services/src/http/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use monoio_http::{
};
use monolake_core::{
context::PeerAddr,
http::{HttpAccept, HttpError, HttpHandler},
http::{HttpAccept, HttpHandler},
AnyError,
};
use service_async::{
layer::{layer_fn, FactoryLayer},
Expand Down Expand Up @@ -46,7 +47,7 @@ impl<H> HttpCoreService<H> {
where
S: Split + AsyncReadRent + AsyncWriteRent,
H: HttpHandler<CX>,
H::Error: Into<HttpError> + Debug,
H::Error: Into<AnyError> + Debug,
CX: ParamRef<PeerAddr> + Clone,
{
let (reader, writer) = stream.into_split();
Expand Down Expand Up @@ -169,7 +170,7 @@ impl<H> HttpCoreService<H> {
where
S: Split + AsyncReadRent + AsyncWriteRent + Unpin + 'static,
H: HttpHandler<CX>,
H::Error: Into<HttpError> + Debug,
H::Error: Into<AnyError> + Debug,
CX: ParamRef<PeerAddr> + Clone,
{
let mut connection = match monoio_http::h2::server::Builder::new()
Expand Down Expand Up @@ -251,7 +252,7 @@ impl<H, Stream, CX> Service<HttpAccept<Stream, CX>> for HttpCoreService<H>
where
Stream: Split + AsyncReadRent + AsyncWriteRent + Unpin + 'static,
H: HttpHandler<CX>,
H::Error: Into<HttpError> + Debug,
H::Error: Into<AnyError> + Debug,
CX: ParamRef<PeerAddr> + Clone,
{
type Response = ();
Expand Down

0 comments on commit 2b6f5b4

Please sign in to comment.