Skip to content

Conversation

@jackyzha0
Copy link
Member

Why

previously, if you accidentally sent the wrong payload (e.g. mismatched service versions), you would get expected requestData or control payload which is a very unclear message given that you did provide requestData, its just wrong

What changed

  • tweaked the error message to be more straightforward
  • include extras in the invalid message back to the client

Versioning

  • Breaking protocol change
  • Breaking ts/js API change

@jackyzha0 jackyzha0 requested a review from a team as a code owner March 20, 2025 23:49
@jackyzha0 jackyzha0 requested review from blast-hardcheese and removed request for a team March 20, 2025 23:49
Type.Object({
code: Type.Literal(INVALID_REQUEST_CODE),
message: Type.String(),
extras: Type.Optional(
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this is spicy, but how do we feel about keeping this a record instead of an object? Just feels like extras shouldn't necessarily have meaning.

Copy link
Member Author

Choose a reason for hiding this comment

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

just for this type if u use it directly, in the union its absorbed by the record type

@jackyzha0 jackyzha0 merged commit 21231e5 into main Mar 21, 2025
6 checks passed
@jackyzha0 jackyzha0 deleted the jackyzha0/better-validation-errors branch March 21, 2025 16:21
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.

4 participants