mirror of
https://github.com/langgenius/dify.git
synced 2026-11-13 14:51:39 +08:00
Co-authored-by: Jyong <76649700+JohnJyong@users.noreply.github.com> Co-authored-by: hjlarry <hjlarry@163.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: zhaohao1004 <zhaohao1004@gmail.com> Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: FFXN <lizy@dify.ai>
10 lines
534 B
TypeScript
10 lines
534 B
TypeScript
import { getHttpErrorStatus } from '@/service/http-error'
|
|
import { knowledgeFsRequestFailureMessageKey } from '../knowledge-fs-task-error'
|
|
|
|
export async function settingsSaveErrorMessageKey(error: unknown) {
|
|
const status = getHttpErrorStatus(error) ?? (error instanceof Response ? error.status : undefined)
|
|
if (status === undefined) return 'settings.saveFailed' as const
|
|
if (status === 403) return 'permissionRestricted' as const
|
|
return (await knowledgeFsRequestFailureMessageKey(error)) ?? ('settings.saveFailed' as const)
|
|
}
|