@pxp-nd/flow 1.1.6 → 1.1.7

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.
@@ -234,7 +234,7 @@ let Flow = class Flow extends core_1.Controller {
234
234
  }
235
235
  }
236
236
  async saveFlow(params, manager) {
237
- var _a, _b;
237
+ var _a, _b, _c, _d;
238
238
  let nodeRefIds = params.board.columns['2-column-nodes-configured'].taskIds;
239
239
  let nodes = params.board.tasks ? params.board.tasks : [];
240
240
  let masterId = null;
@@ -349,7 +349,14 @@ let Flow = class Flow extends core_1.Controller {
349
349
  }
350
350
  }
351
351
  catch (error) {
352
- console.error("Not valid json", error);
352
+ if (axios_1.default.isAxiosError(error) && error.response) {
353
+ const message = ((_c = (_b = error.response.data) === null || _b === void 0 ? void 0 : _b.error) === null || _c === void 0 ? void 0 : _c.message) || 'Unknown error';
354
+ throw new core_1.PxpError(400, message);
355
+ }
356
+ else {
357
+ console.error("Not valid json", error);
358
+ throw new core_1.PxpError(500, 'Unexpected error while processing the request');
359
+ }
353
360
  }
354
361
  }
355
362
  }
@@ -397,7 +404,7 @@ let Flow = class Flow extends core_1.Controller {
397
404
  data: params,
398
405
  };
399
406
  const resControllerAxios = await (0, axios_1.default)(config);
400
- const chainedFlowId = (_b = resControllerAxios.data) === null || _b === void 0 ? void 0 : _b.flowId;
407
+ const chainedFlowId = (_d = resControllerAxios.data) === null || _d === void 0 ? void 0 : _d.flowId;
401
408
  const parsedValues = {
402
409
  flowId: chainedFlowId
403
410
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pxp-nd/flow",
3
- "version": "1.1.06",
3
+ "version": "1.1.07",
4
4
  "description": "Workflow module for pxp-nd framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",