Skip to content

Commit

Permalink
print value while validation failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Enity committed May 3, 2024
1 parent 45a4be7 commit 5738212
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/builder/builder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as fs from 'fs';
import { promisify } from 'util';
import * as util from 'util';
import { plainToInstance } from 'class-transformer';
import type { ValidationError } from 'class-validator';
import { validateSync } from 'class-validator';
Expand Down Expand Up @@ -321,7 +322,9 @@ const buildConfigInternal = <T extends object>(

if (opts.throwOnValidatonError === true && errors.length !== 0) {
throw new TurboConfigValidationErr(
`\n${errors.map((e) => e.toString()).join('\n')}`,
`\n${errors
.map((e) => `${e.toString()} Got value "${util.format(e.value)}"`)
.join('\n')}`,
);
}

Expand Down

0 comments on commit 5738212

Please sign in to comment.