From 45d9eca38b4af4ab6e0df4573656bc657172b3a0 Mon Sep 17 00:00:00 2001 From: Junyi Date: Wed, 1 May 2024 13:28:22 +0800 Subject: [PATCH] fix(plugin-workflow-request): fix response log (#4249) --- .../src/server/RequestInstruction.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/plugins/@nocobase/plugin-workflow-request/src/server/RequestInstruction.ts b/packages/plugins/@nocobase/plugin-workflow-request/src/server/RequestInstruction.ts index de20689008..07a627da32 100644 --- a/packages/plugins/@nocobase/plugin-workflow-request/src/server/RequestInstruction.ts +++ b/packages/plugins/@nocobase/plugin-workflow-request/src/server/RequestInstruction.ts @@ -84,15 +84,20 @@ export default class extends Instruction { status: JOB_STATUS.RESOLVED, result: response.data, }); + processor.logger.info(`request (#${node.id}) response success, status: ${response.status}`); }) .catch((error) => { job.set({ status: JOB_STATUS.FAILED, result: error.isAxiosError ? error.toJSON() : error.message, }); + if (error.response) { + processor.logger.info(`request (#${node.id}) response failed, status: ${error.response.status}`); + } else { + processor.logger.error(`request (#${node.id}) response failed: ${error.message}`); + } }) .finally(() => { - processor.logger.info(`request (#${node.id}) response received, status: ${job.get('status')}`); this.workflow.resume(job); });