fix: add logging to silent error swallowing in badge lookup (#150) #152
No reviewers
Labels
No Label
ai-changes-requested
ai-failed
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
ai-working
bug
enhancement
feature
in-queue
performance
security
tech-debt
todo
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-discord#152
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "issue/150-fix-add-logging-to-silent-error-swallowing-in-badg"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
except Exception: passwithlogging.debug(..., exc_info=True)inget_card_embeds()athelpers/main.py:123Test plan
helpers/main.pychange:except Exception as e:+logging.debug(f"badge lookup failed for card {card.get('id')}: {e}", exc_info=True)Closes #150
🤖 Generated with Claude Code
AI Code Review
Files Reviewed
helpers/main.py(modified)Findings
Correctness
loggingis already imported at line 3 — no new import needed.card.get('id')in the log message is the correct safe form: the MEMORY.md design-gap note (from PR #143 review) documented that callers such as/playerand/buypass cards fromget_blank_team_card()which have no'id'field, makingcard['id']at line 118 the likely source of the swallowedKeyError. Using.get()in the log message handles that safely.exc_info=Truecaptures the full traceback fromsys.exc_info(). Including{e}in the format string also surfaces the exception message inline — redundant but harmless and a common pattern."".Security
Style & Conventions
logging.debug(...)) matches the pre-existing pattern in the same file (logging.warning(),logging.error()at lines 217/228).Suggestions
/refractor status) is a pre-existing separate issue, correctly out of scope here.Verdict: APPROVED
(Gitea blocks self-approval — posting as COMMENT. Treat as APPROVED.)
Minimal, correct change. Replaces a silent
passwith alogging.debugthat is traceable atLOG_LEVEL=DEBUGwithout any functional impact on card display. Directly addresses the silent failure documented in issue #150 and the design gap flagged in the PR #143 review.Automated review by Claude PR Reviewer
Approved via pd-pr
Approved via pd-pr