mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-11-09 17:24:41 +00:00
Patch a bug on writing to stdout, and add clearer error on openning data files
This commit is contained in:
1 parent
bdb96dda94
commit
31bfc88eb9
43 files changed
+1654
-696
No files matched your search
@@ -188,3 +188,17 @@ func CLIReadBioSequences(filenames ...string) (obiiter.IBioSequence, error) {
|
||||
|
||||
return iterator, nil
|
||||
}
|
||||
|
||||
func OpenSequenceDataErrorMessage(args []string, err error) {
|
||||
if err != nil {
|
||||
switch len(args) {
|
||||
case 0:
|
||||
log.Errorf("Cannot open stdin (%v)", err)
|
||||
case 1:
|
||||
log.Errorf("Cannot open file %s: %v", args[0], err)
|
||||
default:
|
||||
log.Errorf("Cannot open one of the data files: %v", err)
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user