MCPcopy
hub / github.com/prettier/prettier / createEpipeErrorHandler

Function createEpipeErrorHandler

tests/integration/run-cli.js:53–75  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

51 };
52 const { promise, resolve, reject } = promiseWithResolvers();
53 const createEpipeErrorHandler = (event) => (error) => {
54 if (!error) {
55 return;
56 }
57
58 // It can fail with `write EPIPE` error when running node with unsupported flags like `--experimental-strip-types`
59 // Let's ignore and wait for the `close` event
60 if (
61 error.code === "EPIPE" &&
62 error.syscall === "write" &&
63 nodeOptions.length > 0
64 ) {
65 if (IS_CI) {
66 // eslint-disable-next-line no-console
67 console.error(
68 Object.assign(error, { event, dir, args, options, worker }),
69 );
70 }
71 return;
72 }
73
74 reject(error);
75 };
76
77 const nodeOptions = options?.nodeOptions ?? [];
78 const env = {

Callers 1

runCliWorkerFunction · 0.85

Calls 1

rejectFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…