Skip to content

feat: implement global API error interceptor (#76)#91

Merged
RUKAYAT-CODER merged 1 commit intorinafcode:mainfrom
deborahamoni0-prog:feat/global-api-error-interceptor
Mar 25, 2026
Merged

feat: implement global API error interceptor (#76)#91
RUKAYAT-CODER merged 1 commit intorinafcode:mainfrom
deborahamoni0-prog:feat/global-api-error-interceptor

Conversation

@deborahamoni0-prog
Copy link
Copy Markdown
Contributor

  • Add src/lib/api.ts: centralized apiClient with single fetch wrapper
    • Handles timeout (10s AbortController), auth headers, 4xx/5xx/network errors
    • All errors normalized through parseApiError before throwing
  • Add src/utils/error-handler.ts: parseApiError() utility + ApiError class
    • Reuses existing ErrorType/ErrorInfo from errorUtils.ts
  • Refactor src/app/mobile/services/api.ts to use apiClient
  • Refactor login/signup pages to use apiClient + parseApiError
  • Fix pre-existing lint/prettier/type errors to unblock CI

Closes #76

Summary

Related Issue

Closes #

Type of change

  • Feature
  • Bug fix
  • Chore / Refactor
  • Docs

Screenshots / Recording (if UI)

Testing

  • npm run type-check
  • npm run lint
  • npm run test
  • npm run build

Quality gate checklist

  • CI checks pass (Frontend CI)
  • At least 1–2 approvals (per branch protection rules)
  • Branch is up-to-date with the base branch
  • All conversations resolved
  • PR description includes Closes #<#76>

- Add src/lib/api.ts: centralized apiClient with single fetch wrapper
  - Handles timeout (10s AbortController), auth headers, 4xx/5xx/network errors
  - All errors normalized through parseApiError before throwing
- Add src/utils/error-handler.ts: parseApiError() utility + ApiError class
  - Reuses existing ErrorType/ErrorInfo from errorUtils.ts
- Refactor src/app/mobile/services/api.ts to use apiClient
- Refactor login/signup pages to use apiClient + parseApiError
- Fix pre-existing lint/prettier/type errors to unblock CI

Closes rinafcode#76
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 24, 2026

@deborahamoni0-prog 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

@RUKAYAT-CODER
Copy link
Copy Markdown
Contributor

RUKAYAT-CODER commented Mar 25, 2026

246 files changed????

@RUKAYAT-CODER
Copy link
Copy Markdown
Contributor

support our project by giving us a star

@RUKAYAT-CODER RUKAYAT-CODER merged commit d4aa075 into rinafcode:main Mar 25, 2026
3 of 6 checks passed
@deborahamoni0-prog
Copy link
Copy Markdown
Contributor Author

alright thanks

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.

Global API Error Interceptor

2 participants