edf2csv 0.8.65 → 0.8.67
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 +18 -1
- package/dist/cli.js.map +1 -1
- package/dist/convert/run.js +24 -4
- package/dist/convert/run.js.map +1 -1
- package/package.json +1 -1
package/dist/convert/run.js
CHANGED
|
@@ -1287,7 +1287,8 @@ function writeHint(cause, toStdout = false) {
|
|
|
1287
1287
|
? 'What reached stdout before it failed is incomplete and should not be used. '
|
|
1288
1288
|
: 'The files written so far are incomplete and should not be used. ';
|
|
1289
1289
|
return (preamble +
|
|
1290
|
-
destinationAdvice(cause, toStdout ? 'redirect it somewhere else' : 'choose another with --out', toStdout ? 'redirect it somewhere shorter' : 'choose a shorter destination with --out'
|
|
1290
|
+
destinationAdvice(cause, toStdout ? 'redirect it somewhere else' : 'choose another with --out', toStdout ? 'redirect it somewhere shorter' : 'choose a shorter destination with --out', 'Part of that path no longer exists; make sure nothing is removing it while the ' +
|
|
1291
|
+
'conversion runs.'));
|
|
1291
1292
|
}
|
|
1292
1293
|
/**
|
|
1293
1294
|
* The same question asked before anything has been written: the output directory could not be
|
|
@@ -1305,10 +1306,11 @@ function writeHint(cause, toStdout = false) {
|
|
|
1305
1306
|
* between the two, so the sentences themselves are shared rather than copied.
|
|
1306
1307
|
*/
|
|
1307
1308
|
function createHint(cause) {
|
|
1308
|
-
return destinationAdvice(cause, 'choose another with --out', 'choose a shorter destination with --out'
|
|
1309
|
+
return destinationAdvice(cause, 'choose another with --out', 'choose a shorter destination with --out', 'Part of that path cannot be created — a symbolic link with nothing behind it, or a ' +
|
|
1310
|
+
'mount point that is not mounted; choose another with --out.');
|
|
1309
1311
|
}
|
|
1310
1312
|
/** The sentence an errno earns, with the two phrases that name where "somewhere else" is. */
|
|
1311
|
-
function destinationAdvice(cause, elsewhere, shorter) {
|
|
1313
|
+
function destinationAdvice(cause, elsewhere, shorter, missing) {
|
|
1312
1314
|
const code = cause?.code;
|
|
1313
1315
|
switch (code) {
|
|
1314
1316
|
case 'ENOSPC':
|
|
@@ -1322,8 +1324,26 @@ function destinationAdvice(cause, elsewhere, shorter) {
|
|
|
1322
1324
|
return `That filesystem is mounted read-only; ${elsewhere}.`;
|
|
1323
1325
|
case 'EISDIR':
|
|
1324
1326
|
return `A directory is sitting where that file belongs; remove or rename it, or ${elsewhere}.`;
|
|
1327
|
+
/*
|
|
1328
|
+
The one errno whose sentence is not the same question at both call sites.
|
|
1329
|
+
|
|
1330
|
+
Mid-conversion, a missing component is a directory that went away under a run that had
|
|
1331
|
+
already written into it, and "make sure nothing is removing it" is the thing to check.
|
|
1332
|
+
Before anything is written it is the opposite: the destination's parents are created
|
|
1333
|
+
recursively, so reaching ENOENT there means a component that cannot be created — a
|
|
1334
|
+
symbolic link with nothing behind it, or a mount point that is not mounted.
|
|
1335
|
+
|
|
1336
|
+
$ edf2csv rec.edf --out /mnt/archive/out
|
|
1337
|
+
error: Cannot create "/mnt/archive/out": part of the path does not exist.
|
|
1338
|
+
Part of that path no longer exists; make sure nothing is removing it
|
|
1339
|
+
while the conversion runs.
|
|
1340
|
+
|
|
1341
|
+
Nothing is removing it and nothing was there. `createHint`'s own docstring says the
|
|
1342
|
+
preamble "is the only thing that differs between the two, so the sentences themselves
|
|
1343
|
+
are shared rather than copied" — and this is the sentence where that was not so.
|
|
1344
|
+
*/
|
|
1325
1345
|
case 'ENOENT':
|
|
1326
|
-
return
|
|
1346
|
+
return missing;
|
|
1327
1347
|
case 'ENAMETOOLONG':
|
|
1328
1348
|
return `That path is longer than the filesystem allows; ${shorter}.`;
|
|
1329
1349
|
case 'EMFILE':
|