Skip to content

fix: include exception detail in shared-key decrypt error#525

Open
cconstab wants to merge 1 commit into
trunkfrom
fix/decrypt-error-detail
Open

fix: include exception detail in shared-key decrypt error#525
cconstab wants to merge 1 commit into
trunkfrom
fix/decrypt-error-detail

Conversation

@cconstab

@cconstab cconstab commented Jul 2, 2026

Copy link
Copy Markdown
Member

In at_client/atclient.py, get_encryption_key_shared_by_me() raised:

raise AtDecryptionException(f"Failed to decrypt {to_lookup} - e")

The e is a literal character, not the interpolated exception, so shared-key decrypt
failures printed ... - e with no detail — making the underlying problem impossible
to diagnose. The sibling handlers (same file, ~L169 and ~L310) correctly use {e}.

Fix: interpolate the exception (- {e}).

Tests: test/decrypt_error_test.py — network-free; forces a decrypt failure via a
mocked connection and asserts the raised message includes the real exception (not the
literal e).

Small, isolated, and unblocks diagnosis of an intermittent "Failed to decrypt
shared_key…" seen on long-lived clients.

get_encryption_key_shared_by_me raised AtDecryptionException with the literal
string 'e' instead of the interpolated {e}, so the actual decryption error was
hidden (messages read '... - e'). Interpolate the exception like the sibling
handlers do.
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.

1 participant