Skip to content

Added: Thread exception hook for logging#1960

Open
oliv3r wants to merge 1 commit into
retrospect-addon:masterfrom
oliv3r:exception_hook
Open

Added: Thread exception hook for logging#1960
oliv3r wants to merge 1 commit into
retrospect-addon:masterfrom
oliv3r:exception_hook

Conversation

@oliv3r

@oliv3r oliv3r commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Without a custom threading.excepthook, unhandled exceptions in background threads are dispatched to Python's default handler, which writes to stderr. In a Kodi environment this output is typically discarded, meaning thread failures go completely unnoticed and cannot be diagnosed from the add-on log.

WebDialogue already spawns a daemon thread to run its HTTP server, and as we expand the use of background threads we need these failures to surface in Retrospect's own log rather than be silently dropped. Installing the hook at add-on startup ensures any unhandled thread exception is captured and logged with a full traceback through the normal Logger path.

Without a custom threading.excepthook, unhandled exceptions in background
threads are dispatched to Python's default handler, which writes to stderr.
In a Kodi environment this output is typically discarded, meaning thread
failures go completely unnoticed and cannot be diagnosed from the add-on log.

WebDialogue already spawns a daemon thread to run its HTTP server, and as
we expand the use of background threads we need these failures to surface
in Retrospect's own log rather than be silently dropped. Installing the
hook at add-on startup ensures any unhandled thread exception is captured
and logged with a full traceback through the normal Logger path.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
@sonarqubecloud

sonarqubecloud Bot commented Apr 9, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment on it to reset.

@github-actions github-actions Bot added the stale Stale issues/PR's label Jun 8, 2026
@basrieter basrieter removed the stale Stale issues/PR's label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants