edf2csv 0.7.257 → 0.7.259

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -18,7 +18,7 @@ import process from 'node:process';
18
18
  import { EdfError } from './edf/errors.js';
19
19
  import { EdfFile } from './edf/reader.js';
20
20
  import { buildPlan, withoutFileRateWarning } from './convert/plan.js';
21
- import { ConversionError, USAGE_ERROR_CODES, auditStdout, convert, defaultOutputDir, durationDiagnostics, requestedAnnotationWindow, noAnnotations, noSignalFile, stdoutRefusal, } from './convert/run.js';
21
+ import { ConversionError, USAGE_ERROR_CODES, auditStdout, convert, defaultOutputDir, describeFsError, durationDiagnostics, requestedAnnotationWindow, noAnnotations, noSignalFile, stdoutRefusal, } from './convert/run.js';
22
22
  import { ChannelSelectionError } from './convert/channels.js';
23
23
  // Shared with the library so a bad option is the same error whichever way it arrived.
24
24
  import { MAX_DECIMALS, OptionError } from './convert/options.js';
@@ -188,7 +188,11 @@ function ignoreBrokenPipe(stream) {
188
188
  */
189
189
  if (stream.listenerCount('error') > 1)
190
190
  return;
191
- process.stderr.write(`error: Writing to ${stream === process.stdout ? 'stdout' : 'stderr'} failed: ${error.message}\n`);
191
+ // Through `describeFsError`, like the two failures raised inside the conversion. This is
192
+ // the last-resort listener, so it is the one path where Node's own text — errno token,
193
+ // syscall and all — had nothing in front of it.
194
+ process.stderr.write(`error: Writing to ${stream === process.stdout ? 'stdout' : 'stderr'} failed: ` +
195
+ `${describeFsError(error)}.\n`);
192
196
  process.exitCode = EXIT_ERROR;
193
197
  });
194
198
  }