From 36faf41b81bdcda671fab32dd1f026c721097b6d Mon Sep 17 00:00:00 2001 From: Valentin Knabel Date: Thu, 13 Apr 2023 18:26:24 +0200 Subject: [PATCH] fix: ignore some pipe errors we cannot do anything about --- CHANGELOG.md | 1 + src/UserInteraction.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8bcc78..1c3e48c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # 1.6.3 - fix: join paths correctly on windows #21 +- fix: ignore some pipe errors we cannot do anything about # 1.6.2 diff --git a/src/UserInteraction.ts b/src/UserInteraction.ts index 5f5b329..65f36ce 100644 --- a/src/UserInteraction.ts +++ b/src/UserInteraction.ts @@ -18,7 +18,9 @@ export async function handleFormatError( function matches(...codeOrStatus: Array) { return codeOrStatus.some(c => c === error.code || c === error.status); } - if (matches("ENOENT", 127)) { + if (matches("ENOBUFS", "EPIPE")) { + return; + } else if (matches("ENOENT", "EACCES", 127)) { const selection = await Current.editor.showErrorMessage( `Could not find SwiftFormat: ${Current.config .swiftFormatPath(document)