Files
2a6764edc5 feat: add reusable network access group APIs (#41025)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: CodingOnStar <hanxujiang@dify.com>
Co-authored-by: hjlarry <hjlarry@163.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
2026-10-20 05:52:18 +00:00

15 lines
517 B
TypeScript

export function getNetworkAccessErrorStatus(error: unknown): number | undefined {
if (error instanceof Response) return error.status
if (typeof error === 'object' && error !== null) {
if ('status' in error && typeof error.status === 'number') return error.status
if (
'response' in error &&
typeof error.response === 'object' &&
error.response !== null &&
'status' in error.response &&
typeof error.response.status === 'number'
)
return error.response.status
}
}