Skip to content

Error handling#18

Merged
Zaiidmo merged 20 commits intomasterfrom
error-handling
Feb 4, 2026
Merged

Error handling#18
Zaiidmo merged 20 commits intomasterfrom
error-handling

Conversation

@a-elkhiraooui-ciscode
Copy link
Contributor

Summary

  • What does this PR change?

Why

  • Why is this change needed?

Checklist

  • Added/updated tests (if behavior changed)
  • npm run lint passes
  • npm run typecheck passes
  • npm test passes
  • npm run build passes
  • Added a changeset (npx changeset) if this affects consumers

Notes

  • Anything reviewers should pay attention to?

@a-elkhiraooui-ciscode a-elkhiraooui-ciscode requested review from a team and Copilot February 4, 2026 09:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates error handling across authentication pages by introducing a centralized error message extraction utility. The changes replace scattered, inconsistent error handling logic with a single extractHttpErrorMessage function that standardizes how HTTP errors are processed and displayed to users.

Changes:

  • Added extractHttpErrorMessage utility to extract user-facing error messages from various HTTP error response shapes
  • Updated all authentication pages (SignIn, SignUp, ForgotPassword, ResetPassword) to use the centralized error helper
  • Added interceptor integration to surface refresh token errors via sessionStorage for display on the login page

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/utils/errorHelpers.ts New utility for extracting standardized error messages from HTTP responses
src/utils/attachAuthInterceptor.ts Captures refresh token errors and stores them in sessionStorage for display
src/pages/auth/SignInPage.tsx Replaces status-code-based error handling with centralized utility and displays stored auth errors
src/pages/auth/SignUpPage.tsx Removes status-specific error mapping in favor of centralized extraction
src/pages/auth/ResetPasswordPage.tsx Simplifies error handling by delegating to extraction utility
src/pages/auth/ForgotPasswordPage.tsx Changes from generic success message to displaying actual backend errors
package.json Version bump to 1.0.13

@Zaiidmo Zaiidmo merged commit ff17360 into master Feb 4, 2026
1 check passed
@Zaiidmo Zaiidmo deleted the error-handling branch February 4, 2026 09:29
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.

2 participants