From 8336b9b87bfa515636e303397e14dddb297ab009 Mon Sep 17 00:00:00 2001 From: Ahmed Date: Wed, 19 Dec 2018 14:02:22 +0100 Subject: [PATCH 1/2] Add EPIPE fix --- src/lib/cli/command.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/cli/command.js b/src/lib/cli/command.js index 03c046dd8..bdfb9cd05 100644 --- a/src/lib/cli/command.js +++ b/src/lib/cli/command.js @@ -22,6 +22,9 @@ import { trackEvent } from 'lib/tracker'; import pager from 'lib/cli/pager'; function uncaughtError( err ) { + // Error raised when trying to write to an already closed stream + if ( err.code === 'EPIPE' ) return; + console.log(); console.log( ' ', chalk.red( '✕' ), ' Unexpected error: Please contact VIP Support with the following error:' ); console.log( ' ', chalk.dim( err.stack ) ); From dfeb3a72059b50a1b8916e7f20ae0d3c985c8255 Mon Sep 17 00:00:00 2001 From: Ahmed Date: Thu, 17 Jan 2019 12:25:26 +0100 Subject: [PATCH 2/2] add curly braces to if statement --- src/lib/cli/command.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/cli/command.js b/src/lib/cli/command.js index 04aa08349..4370f9602 100644 --- a/src/lib/cli/command.js +++ b/src/lib/cli/command.js @@ -23,7 +23,9 @@ import pager from 'lib/cli/pager'; function uncaughtError( err ) { // Error raised when trying to write to an already closed stream - if ( err.code === 'EPIPE' ) return; + if ( err.code === 'EPIPE' ) { + return; + } console.log(); console.log( ' ', chalk.red( '✕' ), ' Unexpected error: Please contact VIP Support with the following error:' );