Skip to content

feat: distinguish CORS failures from generic network errors (#1163) - #1287

Open
abdulqudus-dev wants to merge 1 commit into
rinafcode:mainfrom
abdulqudus-dev:feat/1163-cors-error-distinction
Open

feat: distinguish CORS failures from generic network errors (#1163)#1287
abdulqudus-dev wants to merge 1 commit into
rinafcode:mainfrom
abdulqudus-dev:feat/1163-cors-error-distinction

Conversation

@abdulqudus-dev

Copy link
Copy Markdown

closes #1163

  • Add CORS_BLOCKED to ErrorType enum in errorUtils.ts
  • Add isCorsError() utility: detects opaque CORS TypeErrors by message pattern (Failed to fetch, NetworkError, cross-origin, CORS, Load failed) with no attached HTTP status code
  • Wire isCorsError() into classifyError() before the NETWORK branch; CORS errors are non-retryable (server config must change, not the client)
  • Update loggingErrorInterceptor (apiInterceptors.ts) to log CORS blocks at a distinct message with errorType: CORS_BLOCKED in context
  • Update ErrorReportingService (errorReporting.ts): add corsBlocked breadcrumb, set corsBlocked flag in errorData, expose corsBlockedCount in getAnalyticsSummary()
  • Add 30 unit tests in cors-detection.test.ts covering isCorsError(), classifyError() CORS path, interceptor branching, and service tagging
  • Update pre-existing errorUtils.test.ts assertions to match new behaviour

Closes #1163

Description

Brief description of changes

Related Issue

Closes #

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No console errors
  • Uses Lucide icons consistently
  • Responsive design implemented
  • Starknet best practices followed

…e#1163)

- Add CORS_BLOCKED to ErrorType enum in errorUtils.ts
- Add isCorsError() utility: detects opaque CORS TypeErrors by message
  pattern (Failed to fetch, NetworkError, cross-origin, CORS, Load failed)
  with no attached HTTP status code
- Wire isCorsError() into classifyError() before the NETWORK branch;
  CORS errors are non-retryable (server config must change, not the client)
- Update loggingErrorInterceptor (apiInterceptors.ts) to log CORS blocks
  at a distinct message with errorType: CORS_BLOCKED in context
- Update ErrorReportingService (errorReporting.ts): add corsBlocked
  breadcrumb, set corsBlocked flag in errorData, expose corsBlockedCount
  in getAnalyticsSummary()
- Add 30 unit tests in cors-detection.test.ts covering isCorsError(),
  classifyError() CORS path, interceptor branching, and service tagging
- Update pre-existing errorUtils.test.ts assertions to match new behaviour

Closes rinafcode#1163
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@abdulqudus-dev 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

Well done on the job done so far!
Kindly fix workflow to pass

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.

Distinguish CORS failures from generic network errors

2 participants