From 86687b414806bbe895e74279078ad0ce4ade602c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 11 Jan 2024 14:12:48 +1000 Subject: [PATCH] Include details on what's missing when a NotFound error is triggered Makes debugging issues like #2939 easier --- rslib/src/error/not_found.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rslib/src/error/not_found.rs b/rslib/src/error/not_found.rs index d446577c3..aef05f63c 100644 --- a/rslib/src/error/not_found.rs +++ b/rslib/src/error/not_found.rs @@ -23,7 +23,12 @@ pub struct NotFoundError { impl NotFoundError { pub fn message(&self, tr: &I18n) -> String { - tr.errors_inconsistent_db_state().into() + format!( + "{} No such {}: '{}'", + tr.errors_inconsistent_db_state(), + self.type_name, + self.identifier + ) } pub fn context(&self) -> String {