Improve error message.

This commit is contained in:
r-vdp 2023-05-15 20:34:48 +02:00
parent c430035749
commit 8602403333
No known key found for this signature in database

View file

@ -26,9 +26,12 @@ pub struct StorePath {
// We cannot implement both From and TryFrom, and we need From for Deserialize... // We cannot implement both From and TryFrom, and we need From for Deserialize...
impl From<String> for StorePath { impl From<String> for StorePath {
fn from(path: String) -> Self { fn from(path: String) -> Self {
PathBuf::from(path) PathBuf::from(path.clone()).try_into().unwrap_or_else(|e| {
.try_into() panic!(
.expect("Error constructing store path, path not in store.") "Error constructing store path, path not in store: {}\n{:?}",
path, e
);
})
} }
} }