-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provide a better error when trying to read a zip file without a manifest #264
Comments
So, this seems a little weird - in utils.rs, pub fn collection_from_zipfile(sigpath: &Path, report_type: &ReportType) -> Result<Collection> {
match Collection::from_zipfile(sigpath) {
Ok(collection) => Ok(collection),
Err(_) => bail!("failed to load {} zipfile: '{}'", report_type, sigpath\
),
}
} and then in sourmash collection.rs, pub fn from_zipfile<P: AsRef<Path>>(zipfile: P) -> Result<Self> {
let storage = ZipStorage::from_file(zipfile)?;
// Load manifest from standard location in zipstorage
let manifest = Manifest::from_reader(storage.load("SOURMASH-MANIFEST.csv")?.as_slice())?;
Ok(Self {
manifest,
storage: InnerStorage::new(storage),
})
} and it would seem to me that |
Figured it out - My guess is that if we encounter an unloadable zipfile we should error-exit - there's no other collection type that should end in .zip - but will think on't. |
Agreed. this comment is perhaps better here, since I suggested the same solution: #280 (comment)
|
Right, we run into the same problem in sourmash of course - |
Re-examined this as part of #430, and we don't need any changes to core sourmash or anything. We just need to say, hey, this is zip file and we can't load it, end here. Probably requires some kind of enum for a loader function to say, don't go any further. |
When we run:
it works fine; but with
we get
It's fine that it doesn't work but it'd be nice to provide a better error message, like "this is a zip file without a manifest, you suxor."
Related issues:
The text was updated successfully, but these errors were encountered: