diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-02-05 08:24:10 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-02-05 09:13:04 -0400 |
commit | f10d5559731a18097dcd6921e2bb343c36269407 (patch) | |
tree | a38d7877998072811e30b34636b14cd3ab69f2f6 /src/util | |
parent | f0af4edfa87e9518703b7c9ab35244911f0a3ac2 (diff) |
handle missing data files more gracefully
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/io.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/io.js b/src/util/io.js index 6cc89b56..12e87f4d 100644 --- a/src/util/io.js +++ b/src/util/io.js @@ -12,7 +12,9 @@ export async function findFiles(dataPath, { try { files = await readdir(dataPath); } catch (error) { - throw new AggregateError([error], `Failed to list files from ${dataPath}`); + throw Object.assign( + new AggregateError([error], `Failed to list files from ${dataPath}`), + {code: error.code}); } return files |