fix: keep every d.errors[] entry in fromHttpError messages#369
Merged
Lakes41 merged 1 commit intoJul 24, 2026
Merged
Conversation
…action Entries without message/msg/code were silently filtered out, hiding validation failures from callers. Each entry now falls back to field: issue rendering, then JSON.stringify. Closes Adamantine-guild#191
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.
Closes #191.
An entry in
d.errors[]withoutmessage/msg/code(e.g.{ field: "guildId", issue: "required" }) was silently dropped by the.filter(Boolean), so a 400 response full of validation failures could surface as a bareHTTP Error: 400with no hint what failed.Precedence is unchanged (string,
message,msg,code), then two new fallbacks:field: issuerendering for validation-shaped entries, andJSON.stringifyfor anything else. Every entry now contributes something.Tests: 4 new cases in tests/errors.test.ts (mixed shapes, JSON fallback, single-entry unwrapped, null/non-object tolerance). errors.test.ts 19/19 pass. Full suite: 250 failed / 808 passed vs 250 / 804 on main, failing sets identical (pre-existing failures in contracts/guildId-encoding/compat suites). tsc --noEmit and eslint on the touched files show the same output as main.