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...
|
||||
impl From<String> for StorePath {
|
||||
fn from(path: String) -> Self {
|
||||
PathBuf::from(path)
|
||||
.try_into()
|
||||
.expect("Error constructing store path, path not in store.")
|
||||
PathBuf::from(path.clone()).try_into().unwrap_or_else(|e| {
|
||||
panic!(
|
||||
"Error constructing store path, path not in store: {}\n{:?}",
|
||||
path, e
|
||||
);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue