Add more detailed error reporting around invalid projects

This commit is contained in:
Lucien Greathouse
2017-12-13 11:55:30 -08:00
parent b74ba141d1
commit 59b2401c2c
3 changed files with 31 additions and 6 deletions

View File

@@ -13,7 +13,7 @@ pub enum ProjectLoadError {
DidNotExist,
FailedToOpen,
FailedToRead,
Invalid,
InvalidJson(serde_json::Error),
}
#[derive(Debug)]
@@ -116,7 +116,7 @@ impl Project {
match serde_json::from_str(&contents) {
Ok(v) => Ok(v),
Err(_) => return Err(ProjectLoadError::Invalid),
Err(e) => return Err(ProjectLoadError::InvalidJson(e)),
}
}