flowscale 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +8 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -236,7 +236,7 @@ var FlowscaleAPI = /** @class */ (function () {
236
236
  */
237
237
  FlowscaleAPI.prototype.executeWorkflowAsync = function (workflowId_1, data_1, groupId_1) {
238
238
  return __awaiter(this, arguments, void 0, function (workflowId, data, groupId, pollIntervalMs, timeoutMs, returnAllOutputsOrOptions) {
239
- var _a, returnAllOutputs, onIntermediateResponse, startTime, executeResponse, runId, resolvedWorkflowId, run_status, output_names, runResponse, attempts, runResponse, latestOutputNames, outputPromises, outputResults, successfulOutputs, pendingOutputs, hasErrors, _i, outputResults_1, result, deprecationWarning, legacyResponse, allOutputsResponse, error_1;
239
+ var _a, returnAllOutputs, onIntermediateResponse, startTime, executeResponse, runId, resolvedWorkflowId, run_status, output_names, runResponse, attempts, runResponse, latestOutputNames, outputPromises, outputResults, successfulOutputs, pendingOutputs, hasErrors, _i, outputResults_1, result, deprecationWarning, legacyResponse, allOutputsResponse, error_1, errorMessage, isIntentionalError;
240
240
  var _this = this;
241
241
  var _b, _c, _d, _e, _f, _g, _h, _j;
242
242
  if (pollIntervalMs === void 0) { pollIntervalMs = 2000; }
@@ -496,7 +496,13 @@ var FlowscaleAPI = /** @class */ (function () {
496
496
  return [3 /*break*/, 22];
497
497
  case 19:
498
498
  error_1 = _k.sent();
499
- // Log the error but continue polling
499
+ errorMessage = error_1 instanceof Error ? error_1.message : String(error_1);
500
+ isIntentionalError = errorMessage.includes('failed with status:') ||
501
+ errorMessage.includes('One or more workflow outputs failed');
502
+ if (isIntentionalError) {
503
+ throw error_1;
504
+ }
505
+ // Transient errors: log and continue polling
500
506
  this.logWarn("Error polling for outputs (attempt ".concat(attempts, "):"), error_1);
501
507
  return [4 /*yield*/, this.emitExecuteWorkflowAsyncIntermediateResponse(onIntermediateResponse, {
502
508
  type: 'poll_retry',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowscale",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "An NPM library for communicating with the Flowscale APIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",