Skip to content

Commit

Permalink
fix(error): throw the full error (rather than the stack)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed Jan 15, 2017
1 parent 503a3dd commit c75290c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ function format({
function prettify(text, formatOptions) {
try {
return prettier.format(text, formatOptions)
} catch (e) {
} catch (error) {
// is this noisy? Try setting options.disableLog to false
logError('prettier formatting failed', e.stack)
throw e
logError('prettier formatting failed', error.stack)
throw error
}
}

Expand All @@ -72,7 +72,7 @@ function eslintFix(text, eslintConfig) {
} catch (error) {
// is this noisy? Try setting options.disableLog to false
logError('eslint fix failed', error.stack)
throw error.stack
throw error
}
}

Expand Down

0 comments on commit c75290c

Please sign in to comment.