mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-31 21:50:53 +00:00
fix failing migration
This commit is contained in:
parent
944fda45e6
commit
06fe87b361
1 changed files with 2 additions and 2 deletions
|
|
@ -23,6 +23,7 @@ export namespace Storage {
|
|||
const MIGRATIONS: Migration[] = [
|
||||
async (dir) => {
|
||||
const project = path.resolve(dir, "../project")
|
||||
if (!fs.exists(project)) return
|
||||
for await (const projectDir of new Bun.Glob("*").scan({
|
||||
cwd: project,
|
||||
onlyFiles: false,
|
||||
|
|
@ -177,8 +178,7 @@ export namespace Storage {
|
|||
|
||||
async function withErrorHandling<T>(body: () => Promise<T>) {
|
||||
return body().catch((e) => {
|
||||
if (!(e instanceof Error))
|
||||
throw e
|
||||
if (!(e instanceof Error)) throw e
|
||||
const errnoException = e as NodeJS.ErrnoException
|
||||
if (errnoException.code === "ENOENT") {
|
||||
throw new NotFoundError({ message: `Resource not found: ${errnoException.path}` })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue