Explorar o código

fix(web): handle s8 task action business errors

The submit handler in S8TaskDetailPage used try/finally with no catch,
so business 4xx responses surfaced in the console as "Uncaught (in
promise)" even though the axios interceptor had already shown the
ElMessage error to the user.

Add an empty catch alongside the finally to swallow the rejection after
the user-visible toast has been shown.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
YY968XX hai 1 mes
pai
achega
bea9e11f91
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      Web/src/views/aidop/s8/exceptions/S8TaskDetailPage.vue

+ 3 - 0
Web/src/views/aidop/s8/exceptions/S8TaskDetailPage.vue

@@ -152,6 +152,9 @@ async function submitAction() {
 		ElMessage.success(`${actionTitle()}成功`);
 		ElMessage.success(`${actionTitle()}成功`);
 		dialogVisible.value = false;
 		dialogVisible.value = false;
 		await loadDetail();
 		await loadDetail();
+	} catch {
+		// 业务 4xx 已由 axios 响应拦截器以 ElMessage.error 提示用户;
+		// 这里吞掉拒绝以避免冒泡为浏览器 "Uncaught (in promise)"。
 	} finally {
 	} finally {
 		submitting.value = false;
 		submitting.value = false;
 	}
 	}