refactor: replace Box<dyn Error> with anyhow::Result

- ingestion_pipeline::run_worker_loop returns anyhow::Result<()>
- api_router::ApiState::new returns anyhow::Result<Self>
- html_router::HtmlState::new_with_resources is infallible, returns Self
- main/server/worker binary entry points return anyhow::Result<()>
This commit is contained in:
Per Stark
2026-05-25 13:48:31 +02:00
parent 79e46e9c09
commit b965c5a2e6
6 changed files with 11 additions and 12 deletions
+3 -4
View File
@@ -22,7 +22,7 @@ use tracing_subscriber::{fmt, prelude::*, EnvFilter};
use tokio::task::LocalSet;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
async fn main() -> anyhow::Result<()> {
// Set up tracing
tracing_subscriber::registry()
.with(fmt::layer().with_writer(std::io::stderr))
@@ -118,7 +118,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
embedding_provider.clone(),
None,
)
.await?;
.await;
let api_state = ApiState::new(&config, storage.clone()).await?;
@@ -295,8 +295,7 @@ mod tests {
embedding_provider,
None,
)
.await
.expect("failed to build html state");
.await;
let api_state = ApiState {
db: db.clone(),