Skip to content

Commit 6483fdc

Browse files
mjpietersmomocow
authored andcommitted
♻️ show constraint messages, not names (#93)
When header validation fails, the constraint message is the human-friendly error string, show that instead of the constraint name.
1 parent 5bca4c8 commit 6483fdc

File tree

1 file changed

+5
-1
lines changed
  • lib/features/validate-headers

1 file changed

+5
-1
lines changed

lib/features/validate-headers/impl.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ export class ValidateHeaders extends Feature<ValidateHeadersOptions> {
5252
});
5353

5454
if (errors.length > 0) {
55-
throw new Error(errors.map((err) => err.toString()).join('\n'));
55+
throw new Error(
56+
errors
57+
.map((err) => err.toString(undefined, undefined, undefined, true))
58+
.join('\n'),
59+
);
5660
}
5761
}
5862

0 commit comments

Comments
 (0)