Browse Source

catch migration failures

Dax Raad 5 months ago
parent
commit
61c7196bd9
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/opencode/src/storage/storage.ts

+ 3 - 1
packages/opencode/src/storage/storage.ts

@@ -115,7 +115,9 @@ export namespace Storage {
     for (let index = migration; index < MIGRATIONS.length; index++) {
       log.info("running migration", { index })
       const migration = MIGRATIONS[index]
-      await migration(dir)
+      await migration(dir).catch((e) => {
+        log.error("failed to run migration", { error: e, index })
+      })
       await Bun.write(path.join(dir, "migration"), (index + 1).toString())
     }
     return {