Merge pull request #387 from gencay/patch-1

pull/403/head
Travis Fischer 2023-02-28 04:00:17 -06:00 zatwierdzone przez GitHub
commit 16b29b6f17
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -12,7 +12,8 @@ export async function fetchSSE(
const { onMessage, ...fetchOptions } = options
const res = await fetch(url, fetchOptions)
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 })
error.statusCode = res.status
error.statusText = res.statusText