Skip to content

Commit

Permalink
improvement: better error output when ext commands fail (e.g. kubectl)
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Sep 18, 2019
1 parent edcef88 commit 4322057
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions garden-service/src/util/ext-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,16 @@ export class BinaryCmd extends Library {
}

async stdout(params: ExecParams) {
const res = await this.exec(params)
return res.stdout
try {
const res = await this.exec(params)
return res.stdout
} catch (err) {
// Add log output to error
if (err.all) {
err.message += "\n\n" + err.all
}
throw err
}
}

async json(params: ExecParams) {
Expand Down

0 comments on commit 4322057

Please sign in to comment.