Improve error message.
This commit is contained in:
parent
c430035749
commit
8602403333
1 changed files with 6 additions and 3 deletions
|
|
@ -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
|
||||||
|
);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue