Repository navigation
B5: Return stable API error codes - #2
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
B5
data.codevalues to errors from all 14 API handlers. Map invite and date failures by operation and keep upstream diagnostics on the server.no_spacefor unpaired date and location writes.Frontend impact
Map the JSON response's
data.codeto an i18n key usingApiErrorCodefromshared/api-errors.ts. Keep the sign-in handling for HTTP 401 and use a generic translated fallback for responses without an API error envelope. Successful responses retain their existing shapes.A bearer-authenticated
PATCH /api/dates/not-a-uuidwith{"title":"Cinema"}returns HTTP 400 with contract fields{"statusCode":400,"data":{"code":"validation_failed"}}. Unpaired date and location writes return 403no_space. Photo validation retains 413 and 415.Tests
4675d39captured 17 failures before the implementation.npm testpassed all 42 tests.npm run buildpassed. The built Nitro server returned the expected health, unauthorized, and malformed-UUID responses.