From 2fdc4299e05bb398e6a0e6aeb9907cfff721250d Mon Sep 17 00:00:00 2001 From: WuYongJie <549727955@qq.com> Date: Wed, 4 Nov 2026 14:57:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=80=9A=E7=94=A8=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=A4=84=E7=90=86=E5=A4=B1=E8=B4=A5=E7=9A=84=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E4=B8=8E=E6=A0=B8=E5=AF=B9=E5=BB=BA=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/request-error.ts | 3 +++ tests/routes/image-provider-error-classification.test.ts | 2 ++ 2 files changed, 5 insertions(+) diff --git a/lib/request-error.ts b/lib/request-error.ts index c18c23167..ec04a765c 100644 --- a/lib/request-error.ts +++ b/lib/request-error.ts @@ -258,6 +258,9 @@ export function getRequestFailureDetails( if (/neither a task ID nor output URLs|已完成.*未取回|completed without.*output/i.test(text)) { return detail("RESULT_UNCONFIRMED", "模型服务没有返回可读取的任务结果,生成状态尚未确认。", "请保留当前任务并联系管理员核对,避免重复生成。", "unknown"); } + if (/(?:抠图|去水印|图片增强|图片|扩图)处理失败/.test(text)) { + return detail("PROCESSING_FAILED", "图片处理服务执行失败,未返回具体原因。", "请联系管理员并提供请求编号,先核对原任务结果,避免重复处理。", "unknown"); + } if (/service_error|upstream_server_error|excessive system load|generate(?: image)? failed/i.test(text)) { return detail("PROVIDER_EXECUTION_FAILED", "模型服务未能完成本次处理。", "请稍后重试;若连续失败,请切换模型或联系管理员,并提供请求编号。"); } diff --git a/tests/routes/image-provider-error-classification.test.ts b/tests/routes/image-provider-error-classification.test.ts index 8dff2cae6..499fb9dcc 100644 --- a/tests/routes/image-provider-error-classification.test.ts +++ b/tests/routes/image-provider-error-classification.test.ts @@ -17,6 +17,8 @@ test("known provider and platform failures explain their cause and next action", ["generate image failed", "PROVIDER_EXECUTION_FAILED", "稍后重试"], ["excessive system load", "PROVIDER_EXECUTION_FAILED", "稍后重试"], ["get image url failed", "SOURCE_IMAGE_UNAVAILABLE", "重新上传"], + ["抠图处理失败", "PROCESSING_FAILED", "核对原任务"], + ["去水印处理失败", "PROCESSING_FAILED", "核对原任务"], ["图片上传到存储桶失败", "RESULT_STORAGE_FAILED", "不要重复生成"], ["任务执行中断,结果尚未确认", "RESULT_UNCONFIRMED", "避免重复生成"], ]) { -- 2.47.2