make error more descriptive
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user