@@ -1,5 +1,6 @@
|
||||
use std::net::SocketAddr;
|
||||
|
||||
use anyhow::Context;
|
||||
use notmad::{Component, ComponentInfo, MadError};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
@@ -20,7 +21,7 @@ impl Component for ServeHttp {
|
||||
|
||||
let listener = tokio::net::TcpListener::bind(self.addr)
|
||||
.await
|
||||
.map_err(|e| MadError::Inner(e.into()))?;
|
||||
.context("failed to listen on port")?;
|
||||
|
||||
tracing::info!("listening on {}", self.addr);
|
||||
|
||||
@@ -29,7 +30,7 @@ impl Component for ServeHttp {
|
||||
cancellation_token.cancelled().await;
|
||||
})
|
||||
.await
|
||||
.map_err(|e| MadError::Inner(e.into()))?;
|
||||
.context("failed to run axum server")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user