|
|
@ -142,13 +142,17 @@ module.exports = function aggregrateAndThrowErrors(errors) {
|
|
|
|
let detailLines = renderErrorList(errors);
|
|
|
|
let detailLines = renderErrorList(errors);
|
|
|
|
let frame = determineLocation();
|
|
|
|
let frame = determineLocation();
|
|
|
|
|
|
|
|
|
|
|
|
let functionString = (frame.alias != null)
|
|
|
|
let locationString = asExpression(() => {
|
|
|
|
? `${frame.alias} [${frame.functionName}]`
|
|
|
|
if (frame != null) {
|
|
|
|
: frame.functionName;
|
|
|
|
let functionString = (frame.alias != null)
|
|
|
|
|
|
|
|
? `${frame.alias} [${frame.functionName}]`
|
|
|
|
|
|
|
|
: frame.functionName;
|
|
|
|
|
|
|
|
|
|
|
|
let locationString = (frame != null)
|
|
|
|
return `${highlightBold(functionString)} in ${highlightBold(frame.shortPath)}, at line ${highlightBold(frame.location.line)} (${frame.location.path})`;
|
|
|
|
? `${highlightBold(functionString)} in ${highlightBold(frame.shortPath)}, at line ${highlightBold(frame.location.line)} (${frame.location.path})`
|
|
|
|
} else {
|
|
|
|
: dimBold(`(could not determine location)`);
|
|
|
|
return dimBold(`(could not determine location)`);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return new AggregrateValidationError(`One or more validation errors occurred at ${locationString}:\n${detailLines}`, {
|
|
|
|
return new AggregrateValidationError(`One or more validation errors occurred at ${locationString}:\n${detailLines}`, {
|
|
|
|
errors: errors
|
|
|
|
errors: errors
|
|
|
|