瀏覽代碼

log errors in catchCause instead of silently swallowing

Kit Langton 1 月之前
父節點
當前提交
b53a95fd81
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      packages/opencode/src/command/index.ts

+ 3 - 1
packages/opencode/src/command/index.ts

@@ -9,8 +9,10 @@ import PROMPT_INITIALIZE from "./template/initialize.txt"
 import PROMPT_REVIEW from "./template/review.txt"
 import PROMPT_REVIEW from "./template/review.txt"
 import { MCP } from "../mcp"
 import { MCP } from "../mcp"
 import { Skill } from "../skill"
 import { Skill } from "../skill"
+import { Log } from "../util/log"
 
 
 export namespace Command {
 export namespace Command {
+  const log = Log.create({ service: "command" })
   export const Event = {
   export const Event = {
     Executed: BusEvent.define(
     Executed: BusEvent.define(
       "command.executed",
       "command.executed",
@@ -155,7 +157,7 @@ export namespace Command {
       })
       })
 
 
       const loadFiber = yield* load().pipe(
       const loadFiber = yield* load().pipe(
-        Effect.catchCause(() => Effect.void),
+        Effect.catchCause((cause) => Effect.sync(() => log.error("init failed", { cause }))),
         Effect.forkScoped,
         Effect.forkScoped,
       )
       )