mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Include details on what's missing when a NotFound error is triggered
Makes debugging issues like #2939 easier
This commit is contained in:
parent
57ec454847
commit
86687b4148
1 changed files with 6 additions and 1 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue