From c75290cc0f6b802a4b5781f3102cb63cc187ba44 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Sat, 14 Jan 2017 23:59:21 -0700 Subject: [PATCH] fix(error): throw the full error (rather than the stack) --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index bebd3006..2ef6a95f 100644 --- a/src/index.js +++ b/src/index.js @@ -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 } } @@ -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 } }