kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
Merge pull request #387 from gencay/patch-1
commit
16b29b6f17
|
@ -12,7 +12,8 @@ export async function fetchSSE(
|
||||||
const { onMessage, ...fetchOptions } = options
|
const { onMessage, ...fetchOptions } = options
|
||||||
const res = await fetch(url, fetchOptions)
|
const res = await fetch(url, fetchOptions)
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
const msg = `ChatGPT error ${res.status || res.statusText}`
|
const reason = await res.text()
|
||||||
|
const msg = `ChatGPT error ${res.status || res.statusText}: ${reason}`
|
||||||
const error = new types.ChatGPTError(msg, { cause: res })
|
const error = new types.ChatGPTError(msg, { cause: res })
|
||||||
error.statusCode = res.status
|
error.statusCode = res.status
|
||||||
error.statusText = res.statusText
|
error.statusText = res.statusText
|
||||||
|
|
Ładowanie…
Reference in New Issue