clarify "unsupported [database] version" error message

When using an incompatible database version (e.g. from an old install of zoxide) this message is displayed frequently. The message should provide helpful information about the underlying problem and possible solution(s).
This commit is contained in:
Kogasa 2023-06-17 15:22:21 -05:00
parent 6dedfcd74a
commit b10f598e66
1 changed files with 4 additions and 1 deletions

View File

@ -226,7 +226,10 @@ impl Database {
deserializer.deserialize(bytes_dirs).context("could not deserialize database")?
}
version => {
bail!("unsupported version (got {version}, supports {})", Self::VERSION)
bail!(
"unsupported database version (got {version}, supports {}), re-create the database",
Self::VERSION
)
}
};