Skip to content

Add throwPlayerAuthError util#896

Merged
tudddorrr merged 1 commit intodevelopfrom
throw-player-auth-error-util
Mar 26, 2026
Merged

Add throwPlayerAuthError util#896
tudddorrr merged 1 commit intodevelopfrom
throw-player-auth-error-util

Conversation

@tudddorrr
Copy link
Copy Markdown
Collaborator

No description provided.

@claude
Copy link
Copy Markdown

claude Bot commented Mar 23, 2026

This is a clean refactoring PR with no behavioral changes. A couple of minor observations:

Minor

status accepts any number

throwPlayerAuthError types status as number, which allows values like 0 or 999. Koa will throw at runtime for invalid codes, but this could be caught at compile time with a narrower type. Low-priority since all call sites already use valid codes.

No unit tests for the new utility

src/lib/errors/throwPlayerAuthError.ts has no corresponding test file. The existing route integration tests cover the error paths indirectly, but a small unit test would confirm the never typing and that message/errorCode are forwarded correctly. Other lib/errors/ files appear to follow the same pattern without unit tests, so this is consistent with the project norm.


Overall the PR looks good. The never return type is correct and the migration is complete for all { message, errorCode } shaped throws. The remaining ctx.throw calls in the folder either use string messages or include an extra field property, so skipping them is appropriate.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.31%. Comparing base (aa9a14c) to head (02fba98).
⚠️ Report is 6 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #896      +/-   ##
===========================================
- Coverage    97.33%   97.31%   -0.02%     
===========================================
  Files          404      405       +1     
  Lines         6525     6526       +1     
  Branches       851      851              
===========================================
  Hits          6351     6351              
  Misses          90       90              
- Partials        84       85       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tudddorrr tudddorrr force-pushed the throw-player-auth-error-util branch 3 times, most recently from 9ef275b to 67dc85b Compare March 23, 2026 23:08
@tudddorrr tudddorrr force-pushed the throw-player-auth-error-util branch from 67dc85b to 02fba98 Compare March 23, 2026 23:08
@tudddorrr tudddorrr merged commit 268c8ba into develop Mar 26, 2026
9 of 10 checks passed
@tudddorrr tudddorrr deleted the throw-player-auth-error-util branch March 26, 2026 23:14
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