Skip to content

Commit

Permalink
Refactor error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Nov 8, 2019
1 parent 26c2a5c commit b4d3d32
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/build/src/log/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,10 @@ ${cyanBright('Running onError methods')}`)
}

const logBuildError = function(error) {
log(redBright.bold(`\n${getHeader('Netlify Build Error')}`))

if (error.cleanStack) {
log(cleanStacks(error.message))
} else {
log(`\n${error.stack}`)
}
log()
const errorStack = error.cleanStack ? cleanStacks(error.message) : `\n${error.stack}`
log(`${redBright.bold(`\n${getHeader('Netlify Build Error')}`)}
${errorStack}
`)
}

const logBuildSuccess = function() {
Expand Down

0 comments on commit b4d3d32

Please sign in to comment.