Include first 10 errors in exception message

This commit is contained in:
Michael B. Gale
2025-10-14 18:56:50 +01:00
parent 0822fb12e7
commit d7a8ae5fdd
4 changed files with 11 additions and 6 deletions

View File

@@ -457,6 +457,8 @@ test("parseUserConfig - throws a ConfigurationError if validation fails", (t) =>
),
{
instanceOf: ConfigurationError,
message:
'The configuration file "test" is invalid: instance.queries is not of a type(s) array.',
},
);

View File

@@ -506,7 +506,7 @@ export function parseUserConfig(
throw new ConfigurationError(
errorMessages.getInvalidConfigFileMessage(
pathInput,
`There are ${result.errors.length} error(s)`,
result.errors.map((e) => e.stack),
),
);
}