Open ctb opened 4 months ago
ahh, found it in utils.rs
:
// Validate sketches
if collection.is_empty() {
eprintln!("No {} signatures loaded, exiting.", report_type);
return Ok(());
}
eprintln!("Loaded {} {} signature(s)", collection.len(), report_type);
Ok(())
Right, this is related to https://github.com/sourmash-bio/sourmash_plugin_branchwater/issues/207.
I can make a new issue to better reflect the new goal, which is to actually err from here, rather than returning Ok.
I was thinking of linking that issue in, but I feel like this is slightly different, because this is a specific error that shouldn't be bypassed. I'll muse more.
ok, sure - I see it. Here you're specifically thinking about zip errors.
So the reason errors are not automatically propagated up is because of way I changed sequential loading to allow manifests (in load_collection
). Previously, if the extension was 'zip', we tried loading as a zipfile. If not, we tried as sig first and then fell back to pathlists. Since manifests and pathlists are so similar, I was having trouble integrating manifests into the same strategy.
Now, we try each loading function (zip > manifest > signature > pathlist). If the file can be loaded, we will load, even if that collection is empty. If we encounter an error, we track it and report the final error. I thought this was working well for reporting the right errors, but apparently not when the zip fails?
I'm definitely open to better sequential loading / error propagation strategies.
A simple zipfile fix would be to only use the zip loading for '.zip' and report errors directly. For the rest, I'm not sure how to better manage loading functions without enforcing file extensions or otherwise specifying which type of input we have (and therefore which loading methods we should try).
when I run:
I get:
it seems a little weird it tells me that "No query signatures loaded, exiting." and then ...keeps on going.
What's even weirder is that I can't figure out where the message is coming from - the strong "No query signatures loaded" doesn't seem to show up in either the branchwater plugin repo, or the sourmash repo!?