Skip to content

Commit

Permalink
Fix hiding all build errors in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto committed Feb 8, 2024
1 parent 0ec4849 commit 6126b42
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions client/src/commands/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,21 +321,26 @@ const improveOutput = (output: string) => {
(err) => !prioritizedErrors.includes(err) && !hiddenErrors.includes(err)
);
const displayErrors = prioritizedErrors.concat(remainingErrors);
output = displayErrors.reduce(
(acc, cur, i) => (i < MAX_ERROR_AMOUNT ? acc + cur : acc),
""
);

if (displayErrors.length > MAX_ERROR_AMOUNT) {
output += [
"Note: This is a shorter version of the error logs to make it easier to debug.",
`Currently ${PgTerminal.bold(
MAX_ERROR_AMOUNT.toString()
)} errors are displayed but there are ${PgTerminal.bold(
displayErrors.length.toString()
)} errors.`,
'Disable "Improve build errors" setting to see the full error output.',
].join(" ");
// Output should be overridden only in the case of display errors length
// being non-zero
if (displayErrors.length) {
output = displayErrors.reduce(
(acc, cur, i) => (i < MAX_ERROR_AMOUNT ? acc + cur : acc),
""
);

if (displayErrors.length > MAX_ERROR_AMOUNT) {
output += [
"Note: This is a shorter version of the error logs to make it easier to debug.",
`Currently ${PgTerminal.bold(
MAX_ERROR_AMOUNT.toString()
)} errors are displayed but there are ${PgTerminal.bold(
displayErrors.length.toString()
)} errors.`,
'Disable "Improve build errors" setting to see the full error output.',
].join(" ");
}
}
}
}
Expand Down

0 comments on commit 6126b42

Please sign in to comment.