Skip to content

Commit c75290c

Browse files
author
Kent C. Dodds
committed
fix(error): throw the full error (rather than the stack)
1 parent 503a3dd commit c75290c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ function format({
4444
function prettify(text, formatOptions) {
4545
try {
4646
return prettier.format(text, formatOptions)
47-
} catch (e) {
47+
} catch (error) {
4848
// is this noisy? Try setting options.disableLog to false
49-
logError('prettier formatting failed', e.stack)
50-
throw e
49+
logError('prettier formatting failed', error.stack)
50+
throw error
5151
}
5252
}
5353

@@ -72,7 +72,7 @@ function eslintFix(text, eslintConfig) {
7272
} catch (error) {
7373
// is this noisy? Try setting options.disableLog to false
7474
logError('eslint fix failed', error.stack)
75-
throw error.stack
75+
throw error
7676
}
7777
}
7878

0 commit comments

Comments
 (0)