fix: abortError handle
This commit is contained in:
parent
1de54caa7e
commit
647ecbfa61
@ -73,16 +73,12 @@ export const isAbortError = (error: any): boolean => {
|
|||||||
if (error instanceof DOMException && error.name === 'AbortError') {
|
if (error instanceof DOMException && error.name === 'AbortError') {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
console.log(
|
|
||||||
typeof error === 'object',
|
|
||||||
error.message === 'Request was aborted.' || error?.message?.includes('signal is aborted without reason')
|
|
||||||
)
|
|
||||||
// 检查 OpenAI 特定的错误结构
|
// 检查 OpenAI 特定的错误结构
|
||||||
if (
|
if (
|
||||||
(error &&
|
error &&
|
||||||
typeof error === 'object' &&
|
typeof error === 'object' &&
|
||||||
(error.message === 'Request was aborted.' || error?.message?.includes('signal is aborted without reason'))) ||
|
(error.message === 'Request was aborted.' || error?.message?.includes('signal is aborted without reason'))
|
||||||
error.stack?.includes('OpenAI.makeRequest')
|
|
||||||
) {
|
) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user