diff --git a/src/modes/server/api/item.rs b/src/modes/server/api/item.rs index 7110f98..479cadf 100644 --- a/src/modes/server/api/item.rs +++ b/src/modes/server/api/item.rs @@ -4,10 +4,8 @@ use axum::{ response::{Json, Response}, http::header, }; -use tokio::io::{AsyncReadExt, AsyncSeekExt}; use log::warn; use std::collections::HashMap; -use anyhow; use crate::services::async_item_service::AsyncItemService; use crate::services::error::CoreError; @@ -252,6 +250,7 @@ pub async fn handle_get_item_content( Ok(response) } Err(e) => { + // Check if the error is ItemNotFound to return 404 if let Some(core_err) = e.downcast_ref::() { if matches!(core_err, CoreError::ItemNotFound(_)) { return Err(StatusCode::NOT_FOUND);