From 0ca61b4d99f02583d641bd18d622b86c0420fea4 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Fri, 15 Nov 2024 23:29:04 +0800 Subject: [PATCH] chore: --- docs/guide/use/custom-script/index.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/guide/use/custom-script/index.md b/docs/guide/use/custom-script/index.md index 06fe12faa..ea5a3ebe8 100644 --- a/docs/guide/use/custom-script/index.md +++ b/docs/guide/use/custom-script/index.md @@ -18,6 +18,10 @@ const res = await ctx.http.request({ key : certKey } }) +if(!res || res.code !== 0){ + //抛异常才能让任务失败 + throw new Error("上传失败") +} //不能用console.log,需要用ctx.logger 才能把日志打印在ui上 ctx.logger.info("上传成功",res.data) @@ -79,3 +83,4 @@ type CustomScriptPlugin = { } ``` +