mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 05:09:09 +08:00
fix(ErrorBlock): 修复错误状态码检查逻辑以支持statusCode字段
This commit is contained in:
parent
dd1d5740d8
commit
20311af8a8
@ -36,7 +36,10 @@ const ErrorMessage: React.FC<{ block: ErrorMessageBlock }> = ({ block }) => {
|
|||||||
|
|
||||||
const i18nKey = block.error && 'i18nKey' in block.error ? `error.${block.error?.i18nKey}` : ''
|
const i18nKey = block.error && 'i18nKey' in block.error ? `error.${block.error?.i18nKey}` : ''
|
||||||
const errorKey = `error.${block.error?.message}`
|
const errorKey = `error.${block.error?.message}`
|
||||||
const errorStatus = block.error && 'status' in block.error ? block.error?.status : undefined
|
const errorStatus =
|
||||||
|
block.error && ('status' in block.error || 'statusCode' in block.error)
|
||||||
|
? block.error?.status || block.error?.statusCode
|
||||||
|
: undefined
|
||||||
|
|
||||||
if (i18n.exists(i18nKey)) {
|
if (i18n.exists(i18nKey)) {
|
||||||
const providerId = block.error && 'providerId' in block.error ? block.error?.providerId : undefined
|
const providerId = block.error && 'providerId' in block.error ? block.error?.providerId : undefined
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user