make error more descriptive
parent
2b4a093da3
commit
51d5bccd34
|
|
@ -79,7 +79,8 @@ export function createOpencodeClient(config?: Config & { directory?: string; exp
|
||||||
)
|
)
|
||||||
client.interceptors.response.use((response) => {
|
client.interceptors.response.use((response) => {
|
||||||
const contentType = response.headers.get("content-type")
|
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
|
return response
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue