From cd4838a474dddd15b7be8263a04d92ae44a70599 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Mon, 25 Aug 2025 18:22:40 -0300 Subject: [PATCH] fix: remove incorrect downcast_ref error handling Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) --- src/modes/server/api/item.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/modes/server/api/item.rs b/src/modes/server/api/item.rs index 958cb83..81b9f9b 100644 --- a/src/modes/server/api/item.rs +++ b/src/modes/server/api/item.rs @@ -195,13 +195,6 @@ pub async fn handle_get_item_latest_content( } Err(CoreError::ItemNotFoundGeneric) => Err(StatusCode::NOT_FOUND), Err(e) => { - // Check if the error is ItemNotFoundGeneric to return 404 - if let Some(core_err) = e.downcast_ref::() { - match core_err { - CoreError::ItemNotFoundGeneric => return Err(StatusCode::NOT_FOUND), - _ => {} - } - } warn!("Failed to find latest item for content: {}", e); Err(StatusCode::INTERNAL_SERVER_ERROR) } @@ -257,13 +250,6 @@ 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::() { - match core_err { - CoreError::ItemNotFound(_) => return Err(StatusCode::NOT_FOUND), - _ => {} - } - } warn!("Failed to get raw content for item {}: {}", item_id, e); Err(StatusCode::INTERNAL_SERVER_ERROR) }