@@ -441,7 +441,7 @@ def combine_csv_files(saved_results: list[str]):
441441 f .write (out_string )
442442
443443
444- def combine_results (saved_results : Sequence [dict [str , str ] | None ]):
444+ def combine_results (saved_results : Sequence [dict [str , str ] | str ]):
445445 """
446446 Combines various types of result files based on the configuration settings.
447447 This function checks the types of results specified in the configuration
@@ -456,13 +456,13 @@ def combine_results(saved_results: Sequence[dict[str, str] | None]):
456456 None
457457 """
458458 if "table" in cfg .RESULT_TYPES :
459- combine_raven_tables ([f ["table" ] for f in saved_results if f ])
459+ combine_raven_tables ([f ["table" ] for f in saved_results if isinstance ( f , dict ) ])
460460
461461 if "kaleidoscope" in cfg .RESULT_TYPES :
462- combine_kaleidoscope_files ([f ["kaleidoscope" ] for f in saved_results if f ])
462+ combine_kaleidoscope_files ([f ["kaleidoscope" ] for f in saved_results if isinstance ( f , dict ) ])
463463
464464 if "csv" in cfg .RESULT_TYPES :
465- combine_csv_files ([f ["csv" ] for f in saved_results if f ])
465+ combine_csv_files ([f ["csv" ] for f in saved_results if isinstance ( f , dict ) ])
466466
467467
468468def merge_consecutive_detections (
@@ -761,8 +761,9 @@ def analyze_file(item) -> dict[str, str] | None:
761761 # Write error log
762762 print (f"Error: Cannot analyze audio file { fpath } .\n " , flush = True )
763763 utils .write_error_log (ex )
764+ msg = str (ex )
764765
765- return None
766+ return msg or repr ( ex ). strip ( "()" )
766767
767768 # Save as selection table
768769 try :
@@ -773,7 +774,7 @@ def analyze_file(item) -> dict[str, str] | None:
773774 print (f"Error: Cannot save result for { fpath } .\n " , flush = True )
774775 utils .write_error_log (ex )
775776
776- return None
777+ return str ( ex )
777778
778779 delta_time = (datetime .datetime .now () - start_time ).total_seconds ()
779780 print (f"Finished { fpath } in { delta_time :.2f} seconds" , flush = True )
0 commit comments