make error more descriptive

pull/21289/head
Brendan Allan 2026-04-08 10:50:00 +08:00
parent 2b4a093da3
commit 51d5bccd34
No known key found for this signature in database
GPG Key ID: 41E835AEA046A32E
1 changed files with 2 additions and 1 deletions

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
})