refactor: Improve error handling and borrowing in item services

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-03 07:32:25 -03:00
parent 1bd3f95627
commit 426eff309b
3 changed files with 6 additions and 6 deletions

View File

@@ -54,7 +54,7 @@ impl AsyncItemService {
f(&conn, &item_service)
})
.await
.unwrap()
.map_err(|e| CoreError::Other(anyhow::anyhow!("Blocking task failed: {}", e)))?
}
pub async fn get_item(&self, id: i64) -> Result<ItemWithMeta, CoreError> {
@@ -186,7 +186,7 @@ impl AsyncItemService {
).map(|(reader, _, _)| reader)
})
.await
.unwrap()?
.map_err(|e| CoreError::Other(anyhow::anyhow!("Blocking task failed: {}", e)))?
};
// Convert the reader into an async stream manually