From c49a63bb109335e384a4e00514985e257754d9c3 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Mon, 25 Aug 2025 18:19:45 -0300 Subject: [PATCH] fix: remove unused imports and add comment for error handling Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) --- src/modes/server/api/item.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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);