Skip to content

feat: normalize API errors before rendering stream mutations - #145

Open
KehiOla wants to merge 1 commit into
StreamPay-Organization:mainfrom
KehiOla:fix/api-error-normalization
Open

feat: normalize API errors before rendering stream mutations#145
KehiOla wants to merge 1 commit into
StreamPay-Organization:mainfrom
KehiOla:fix/api-error-normalization

Conversation

@KehiOla

@KehiOla KehiOla commented Aug 29, 2026

Copy link
Copy Markdown

Closes #140

Summary

This PR implements centralized API error normalization for stream mutations to prevent raw provider and backend error payloads from reaching the UI. All mutation errors are now converted into a consistent, sanitized error format before being rendered or used for retry behavior.

What changed

  • Added a centralized error normalization layer for API and provider errors.
  • Mapped errors to stable application error codes and safe user-facing messages.
  • Classified errors by retryability so retry actions follow a consistent policy.
  • Extracted and preserved correlation IDs where available.
  • Prevented raw provider payloads, stack traces, and sensitive fields from being exposed in the UI.
  • Ensured unknown and malformed errors fail closed with a generic internal error message.
  • Preserved diagnostic information only for protected logging/telemetry paths.

Tests

Added regression coverage for:

  • Error normalization fixtures.
  • Retryability classification.
  • Correlation ID extraction.
  • Redaction of sensitive/provider payloads.
  • Malformed and unknown error inputs.
  • The original failure mode to verify raw provider errors are no longer rendered.

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.

security(frontend): normalize API errors before rendering stream mutations

1 participant