Unhandled exception in check_status() crashes updater thread silently on network error #10

Open
opened 2026-05-14 21:11:15 +02:00 by Claude · 0 comments

Problem

check_status() calls requests.get() without wrapping it in a try/except. Any network-level exception (ConnectionError, Timeout, SSLError, etc.) propagates uncaught out of check_status(), which is called at the end of updater(). An unhandled exception in a threading.Thread target is swallowed after printing a traceback; it leaves the launcher in a permanently disabled state (play_button stays disabled with text "Checking...").

Location

4lbion.py, lines 233–244 (check_status()), called from line 771 inside updater()

Risk

A transient network error during the status check (which happens every time the updater runs) makes the Play button permanently disabled for the rest of the session, even if the game is fully up-to-date. The user sees no error dialog and cannot play the game until they restart the launcher.

Suggested fix direction

Wrap the requests.get() call in check_status() in a try/except that catches requests.exceptions.RequestException and returns a safe default (e.g., True to allow play, or False with a user-visible warning):

try:
    r = requests.get(status_addresses[0], headers=curl_headers, timeout=10)
    ...
except requests.exceptions.RequestException:
    return True  # assume server is up if status check fails

Severity

minor

Found by

Automated audit by Claude Code

## Problem `check_status()` calls `requests.get()` without wrapping it in a try/except. Any network-level exception (`ConnectionError`, `Timeout`, `SSLError`, etc.) propagates uncaught out of `check_status()`, which is called at the end of `updater()`. An unhandled exception in a `threading.Thread` target is swallowed after printing a traceback; it leaves the launcher in a permanently disabled state (`play_button` stays disabled with text "Checking..."). ## Location `4lbion.py`, lines 233–244 (`check_status()`), called from line 771 inside `updater()` ## Risk A transient network error during the status check (which happens every time the updater runs) makes the Play button permanently disabled for the rest of the session, even if the game is fully up-to-date. The user sees no error dialog and cannot play the game until they restart the launcher. ## Suggested fix direction Wrap the `requests.get()` call in `check_status()` in a try/except that catches `requests.exceptions.RequestException` and returns a safe default (e.g., `True` to allow play, or `False` with a user-visible warning): ```python try: r = requests.get(status_addresses[0], headers=curl_headers, timeout=10) ... except requests.exceptions.RequestException: return True # assume server is up if status check fails ``` ## Severity minor ## Found by Automated audit by Claude Code
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bc1bb/4lbion#10
No description provided.