Skip to content

fix: narrow error types and give failures specific, typed handling - #898

Open
michaelsimeon001 wants to merge 1 commit into
rinafcode:mainfrom
michaelsimeon001:fix/michaelsimeon001-types-error-mapping-796-799
Open

fix: narrow error types and give failures specific, typed handling#898
michaelsimeon001 wants to merge 1 commit into
rinafcode:mainfrom
michaelsimeon001:fix/michaelsimeon001-types-error-mapping-796-799

Conversation

@michaelsimeon001

Copy link
Copy Markdown

Adds four small, self-contained modules, one per issue. No existing files are modified, so this merges cleanly alongside the other open PRs.

What's included

Issue Module What it does
#796 src/utils/toError.ts Narrows an unknown caught value to a real Error (preserving the original as cause) so reading .message in a catch block cannot throw a second time and mask the original failure.
#797 src/services/capabilityDegradation.ts Applies failed capability checks to the degradation store so unusable features are actually disabled, and returns which features were degraded for a UI indicator.
#798 src/utils/loginErrorMessages.ts Maps each login failure (401/403/404/429/5xx/network) to its own actionable message instead of one generic "Login failed".
#799 src/types/socketEvents.ts Discriminated SocketEvent union replacing Record<string, any>, plus an isSocketEvent narrowing guard.

Notes

  • Kept deliberately small (each file is under 50 lines) and additive only.

Closes #796
Closes #797
Closes #798
Closes #799

Adds four small, self-contained modules:

- toError: narrows unknown caught values to a real Error so reading .message
  in a catch block cannot throw a second time (rinafcode#796)
- capabilityDegradation: applies failed capability checks to the degradation
  store so unusable features are actually disabled (rinafcode#797)
- loginErrorMessages: maps each login failure to its own actionable message
  instead of one generic "Login failed" (rinafcode#798)
- socketEvents: discriminated union for socket payloads, replacing
  Record<string, any> with compile-time checked event types (rinafcode#799)
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@michaelsimeon001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment