Include details on what's missing when a NotFound error is triggered

Makes debugging issues like #2939 easier
This commit is contained in:
Damien Elmes 2024-01-11 14:12:48 +10:00
parent 57ec454847
commit 86687b4148

View File

@ -23,7 +23,12 @@ pub struct NotFoundError {
impl NotFoundError { impl NotFoundError {
pub fn message(&self, tr: &I18n) -> String { 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 { pub fn context(&self) -> String {