fix(server): remove storage not found defect fallback (#27287)

This commit is contained in:
Shoubhit Dash
2026-05-13 14:15:53 +05:30
committed by GitHub
parent b0dc8e4638
commit 4b041716fc
2 changed files with 20 additions and 5 deletions

View File

@@ -1,6 +1,5 @@
import { Provider } from "@/provider/provider"
import { Session } from "@/session/session"
import { NotFoundError } from "@/storage/storage"
import { iife } from "@/util/iife"
import { NamedError } from "@opencode-ai/core/util/error"
import * as Log from "@opencode-ai/core/util/log"
@@ -24,10 +23,6 @@ export const errorLayer = HttpRouter.middleware<{ handles: unknown }>()((effect)
const error = defect.defect
log.error("failed", { error, cause: Cause.pretty(cause) })
if (error instanceof NotFoundError) {
return Effect.succeed(HttpServerResponse.jsonUnsafe(error.toObject(), { status: 404 }))
}
if (error instanceof NamedError) {
return Effect.succeed(
HttpServerResponse.jsonUnsafe(error.toObject(), {