A live bird collage card for your Home Assistant dashboard.
stderror sometimes has useful info
frederik63da546d980b
diff --git a/scripts/birdnet_analysis.py b/scripts/birdnet_analysis.pyindex fd7153ce..ec34132a 100644--- a/scripts/birdnet_analysis.py+++ b/scripts/birdnet_analysis.py@@ -6,13 +6,14 @@ import signalimport sysimport threadingfrom queue import Queue+from subprocess import CalledProcessErrorimport inotify.adaptersfrom inotify.constants import IN_CLOSE_WRITE-from utils.reporting import extract_detection, summary, write_to_file, write_to_db, apprise, bird_weather, heartbeatfrom server import load_global_model, run_analysisfrom utils.helpers import get_settings, ParseFileName, get_wav_files, write_settings, ANALYZING_NOW+from utils.reporting import extract_detection, summary, write_to_file, write_to_db, apprise, bird_weather, heartbeatshutdown = False@@ -94,7 +95,8 @@ def process_file(file_name, report_queue):report_queue.join()report_queue.put((file, detections))except BaseException as e:- log.exception('Unexpected error:', exc_info=e)+ stderr = e.stderr.decode('utf-8') if isinstance(e, CalledProcessError) else ""+ log.exception(f'Unexpected error: {stderr}', exc_info=e)def handle_reporting_queue(queue):@@ -116,7 +118,8 @@ def handle_reporting_queue(queue):heartbeat()os.remove(file.file_name)except BaseException as e:- log.exception('Unexpected error:', exc_info=e)+ stderr = e.stderr.decode('utf-8') if isinstance(e, CalledProcessError) else ""+ log.exception(f'Unexpected error: {stderr}', exc_info=e)queue.task_done()