Skip to content

Commit

Permalink
fix(ctx): better error.log output from processModules()
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Jun 14, 2018
1 parent 41f1482 commit b0eb86e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import { padEnd, values, flatten } from "lodash"
import { getNames, registerCleanupFunction } from "./util/util"
import { PluginContext } from "./plugin-context"
import { toGardenError } from "./exceptions"

export type ProcessModule = (module: Module) => Promise<Task[]>
export type ProcessService = (service: Service) => Promise<Task[]>
Expand Down Expand Up @@ -52,11 +53,10 @@ export async function processModules({ pluginContext, modules, watch, process }:
const logErrors = (taskResults: TaskResults) => {
for (const result of values(taskResults).filter(r => !!r.error)) {
const divider = padEnd("", 80, "—")
const error = toGardenError(result.error!)
const msg = `\nFailed ${result.description}. Here is the output:\n${divider}\n${error.message}\n${divider}\n`

ctx.log.error(`\nFailed ${result.description}. Here is the output:`)
ctx.log.error(divider)
ctx.log.error(result.error + "")
ctx.log.error(divider + "\n")
ctx.log.error({ msg, error })
}
}

Expand Down

0 comments on commit b0eb86e

Please sign in to comment.