From f10d5559731a18097dcd6921e2bb343c36269407 Mon Sep 17 00:00:00 2001
From: "(quasar) nebula" <qznebula@protonmail.com>
Date: Sun, 5 Feb 2023 08:24:10 -0400
Subject: handle missing data files more gracefully

---
 src/util/io.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/util')

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
-- 
cgit 1.3.0-6-gf8a5