Skip to content

Commit

Permalink
fix: add success/error logging for get task result
Browse files Browse the repository at this point in the history
  • Loading branch information
thsig committed Sep 5, 2019
1 parent e092525 commit d9efa0f
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions garden-service/src/tasks/get-task-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import chalk from "chalk"
import { LogEntry } from "../logger/log-entry"
import { BaseTask, TaskType } from "./base"
import { Garden } from "../garden"
Expand Down Expand Up @@ -49,10 +50,20 @@ export class GetTaskResultTask extends BaseTask {
})
const actions = await this.garden.getActionHelper()

return actions.getTaskResult({
task: this.task,
log,
taskVersion: this.version,
})
let result: RunTaskResult | null
try {
result = await actions.getTaskResult({
task: this.task,
log,
taskVersion: this.version,
})
} catch (err) {
log.setError()
throw err
}

log.setSuccess({ msg: chalk.green(`Done`), append: true })

return result
}
}

0 comments on commit d9efa0f

Please sign in to comment.