Skip to content

Commit

Permalink
fix(utils): improve error loggin
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyhyun committed May 23, 2024
1 parent e859c52 commit 445e35d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class SpawnError extends Error {
}

toString() {
return [this.message, this.stderr, this.stderr].filter(Boolean).join('\n');
return `${this.message}\n${this.stderr}`;
}
}

Expand Down Expand Up @@ -95,10 +95,7 @@ function spawnProcess(command, args, options) {
if (exitCode !== 0) {
reject(
new SpawnError(
[
`${command} ${_.join(args, ' ')} failed with code ${exitCode}`,
stdout
].filter(Boolean).join('\n'),
_.compact([`${command} ${_.join(args, ' ')} failed with code ${exitCode}`, stdout]).join('\n'),
stdout,
stderr
)
Expand Down

0 comments on commit 445e35d

Please sign in to comment.