Browse Source

fix: HTTP Request block error (#914)

Ahmad Kholid 2 years ago
parent
commit
33a7413d0c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/workflowEngine/blocksHandler/handlerWebhook.js

+ 5 - 1
src/workflowEngine/blocksHandler/handlerWebhook.js

@@ -84,7 +84,11 @@ export async function webhook({ data, id }, { refData }) {
       data: returnData,
     };
   } catch (error) {
-    if (fallbackOutput && error.message === 'Failed to fetch') {
+    const fallbackErrors = ['Failed to fetch', 'user aborted'];
+    const executeFallback =
+      fallbackOutput &&
+      fallbackErrors.some((message) => error.message.includes(message));
+    if (executeFallback) {
       return {
         data: '',
         nextBlockId: fallbackOutput,