Log and handle ZeroDivisionError in gauntlet draft
#31
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#31
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
cogs/players.py:998andcogs/players_new/gauntlet.py:152catchZeroDivisionErrorandreturnwith no logging, no user feedback, and no cleanup. User's interaction hangs or ends silently.PR #55 opened: #55
Added
logger.info(f'User declined {this_event["name"]} draft - cancelling')to bothexcept ZeroDivisionErrorhandlers incogs/players.pyandcogs/players_new/gauntlet.py. TheZeroDivisionErroris an intentional user-cancellation signal fromgauntlets.py:664; user-facing feedback ("You'll be back") is already sent there, so only logging was missing.PR included too many unrequested changes. Closed without prejudice
Fixed in PR #85.
Both
except ZeroDivisionErrorblocks now log the error, callgauntlets.wipe_team()for cleanup, and send the same user-facing error message as theexcept Exceptionblocks immediately below them.