fix(httpapi): expose v2 catalog errors (#28498)

This commit is contained in:
Shoubhit Dash
2026-05-21 00:53:35 +05:30
committed by GitHub
parent 7690481fc1
commit 4308dd75fb
8 changed files with 82 additions and 14 deletions

View File

@@ -274,6 +274,26 @@ function setEnvScoped(key: string, value: string) {
}
describe("provider HttpApi", () => {
it.instance.skip(
"returns public v2 provider not found errors",
Effect.gen(function* () {
const instance = yield* TestInstance
const response = yield* Effect.promise(() =>
Promise.resolve(
app().request("/api/provider/missing", { headers: { "x-opencode-directory": instance.directory } }),
),
)
expect(response.status).toBe(404)
expect(yield* Effect.promise(() => response.json())).toEqual({
_tag: "ProviderNotFoundError",
providerID: "missing",
message: "Provider not found: missing",
})
}),
projectOptions,
)
it.instance(
"serves OAuth authorize response shapes",
Effect.gen(function* () {