make error more descriptive

This commit is contained in:
Brendan Allan
2026-04-08 10:50:00 +08:00
parent 2b4a093da3
commit 51d5bccd34
+2 -1
View File
@@ -79,7 +79,8 @@ export function createOpencodeClient(config?: Config & { directory?: string; exp
)
client.interceptors.response.use((response) => {
const contentType = response.headers.get("content-type")
if (contentType === "text/html") throw new Error("Unexpected content-type: " + contentType)
if (contentType === "text/html")
throw new Error("Request is not supported by this version of OpenCode Server (Server responded with text/html)")
return response
})