From fbfc33857d7833eb67f3c0c7286db486352a12a3 Mon Sep 17 00:00:00 2001 From: Condorra Date: Sat, 6 Jan 2024 00:07:01 +1100 Subject: [PATCH] Add a slightly better item decoding error --- blastmud_game/src/db.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/blastmud_game/src/db.rs b/blastmud_game/src/db.rs index 896d111..c213e4d 100644 --- a/blastmud_game/src/db.rs +++ b/blastmud_game/src/db.rs @@ -688,9 +688,10 @@ impl DBTrans { ) .await? { - return Ok(Some(Arc::new(serde_json::from_value::( - item.get("details"), - )?))); + return Ok(Some(Arc::new( + serde_json::from_value::(item.get("details")) + .map_err(|e| format!("Decoding item {}/{}: {}", item_type, item_code, e))?, + ))); } Ok(None) }