Skip to content

refactor: unify API error types - #562

Merged
overprodigy merged 2 commits into
Heliobond:mainfrom
jc1788-byte:refactor/unify-api-errors
Sep 2, 2026
Merged

refactor: unify API error types#562
overprodigy merged 2 commits into
Heliobond:mainfrom
jc1788-byte:refactor/unify-api-errors

Conversation

@jc1788-byte

Copy link
Copy Markdown
Contributor

Summary

  • add a single shared ApiError contract under src/lib/error.ts
  • normalize nested API payloads into the same shape across services
  • cover the behavior with a focused Vitest regression test
  • fix malformed WebAuthn endpoint strings encountered while validating the refactor

Closes #415

Verification

  • npx vitest run src/lib/error.test.ts

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

@jc1788-byte is attempting to deploy a commit to the David Dada's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 1, 2026

Copy link
Copy Markdown

@jc1788-byte 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

@sshdopey sshdopey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work on unifying the API error types! The shared ApiError class and normalizeApiError helper look solid, and the tests cover the key cases. Also nice catch fixing those malformed WebAuthn endpoint strings. This directly addresses issue #415. Keep it up! ❤️

@sshdopey

sshdopey commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready.

@sshdopey sshdopey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a solid step toward unifying API error types across the codebase. The new ApiError class, normalization helpers, and tests directly address the issue's goal of a shared error contract. The extra WebAuthn fix is a nice bonus. Great work! Keep it up! ❤️

@sshdopey

sshdopey commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready.

@overprodigy
overprodigy merged commit 1f91f8d into Heliobond:main Sep 2, 2026
1 of 2 checks passed
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.

refactor: API error types defined differently in 5 places — unify

3 participants