diff --git a/batdetect2/cli.py b/batdetect2/cli.py index 66aada8..9706312 100644 --- a/batdetect2/cli.py +++ b/batdetect2/cli.py @@ -1,4 +1,5 @@ """BatDetect2 command line interface.""" + import os import click @@ -129,10 +130,9 @@ def detect( ): results_path = audio_file.replace(audio_dir, ann_dir) save_results_to_file(results, results_path) - except (RuntimeError, ValueError, LookupError) as err: + except (RuntimeError, ValueError, LookupError, EOFError) as err: error_files.append(audio_file) - click.secho(f"Error processing file!: {err}", fg="red") - raise err + click.secho(f"Error processing file {audio_file}: {err}", fg="red") click.echo(f"\nResults saved to: {ann_dir}")