Skip to content

Commit 36faf41

Browse files
committed
fix: ignore some pipe errors we cannot do anything about
1 parent a14ead5 commit 36faf41

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 1.6.3
22

33
- fix: join paths correctly on windows #21
4+
- fix: ignore some pipe errors we cannot do anything about
45

56
# 1.6.2
67

src/UserInteraction.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export async function handleFormatError(
1818
function matches(...codeOrStatus: Array<number | string>) {
1919
return codeOrStatus.some(c => c === error.code || c === error.status);
2020
}
21-
if (matches("ENOENT", 127)) {
21+
if (matches("ENOBUFS", "EPIPE")) {
22+
return;
23+
} else if (matches("ENOENT", "EACCES", 127)) {
2224
const selection = await Current.editor.showErrorMessage(
2325
`Could not find SwiftFormat: ${Current.config
2426
.swiftFormatPath(document)

0 commit comments

Comments
 (0)