Skip to content

Commit

Permalink
chore: Attempt to make error parsable
Browse files Browse the repository at this point in the history
  • Loading branch information
eMerzh authored Mar 19, 2024
1 parent dd6c72e commit e44ff23
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/commands/validate/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,7 @@ function printInvalidDocuments(
}

function renderErrors(sourceName: string, errors: GraphQLError[], isError = false): string[] {
const errorsAsString = errors.map(e => ` - ${bolderize(e.message)}`).join('\n');

return [
isError ? chalk.redBright('error') : chalk.yellowBright('warn'),
`in ${sourceName}:\n\n`,
errorsAsString,
'\n\n',
];
return errors.map(e => {
return `${isError ? chalk.redBright('error') : chalk.yellowBright('warn')} in ${sourceName}: ${bolderize(e.message)}`
})
}

0 comments on commit e44ff23

Please sign in to comment.