Skip to content

Commit bba7498

Browse files
committed
fix(core): handle unavailable fff index
1 parent e9ee212 commit bba7498

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎packages/core/src/filesystem/search.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,17 @@ export const fffLayer = Layer.effect(
129129
aiMode: true,
130130
}),
131131
catch: (cause) => cause,
132-
}).pipe(Effect.orDie)
133-
if (!result.ok) return yield* Effect.die(result.error)
132+
}).pipe(
133+
Effect.catch((error) => Effect.logWarning("failed to initialize fff", { error }).pipe(Effect.as(undefined))),
134+
)
135+
if (!result?.ok) {
136+
if (result) yield* Effect.logWarning("failed to initialize fff", { error: result.error })
137+
return Service.of({
138+
find: () => Effect.succeed([]),
139+
glob: () => Effect.succeed([]),
140+
grep: () => Effect.succeed([]),
141+
})
142+
}
134143
yield* Effect.addFinalizer(() => Effect.sync(() => result.value.destroy()).pipe(Effect.ignore))
135144
return Service.of({
136145
glob: (input) =>

0 commit comments

Comments
 (0)