snyk 1.934.0 → 1.935.0

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.
@@ -5788,8 +5788,9 @@ exports.pluckPolicies = pluckPolicies;
5788
5788
  "use strict";
5789
5789
 
5790
5790
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5791
- exports.extractResolutionMetaFromScanResult = exports.delayNextStep = void 0;
5791
+ exports.handleProcessingStatus = exports.extractResolutionMetaFromScanResult = exports.delayNextStep = void 0;
5792
5792
  const common_1 = __webpack_require__(70527);
5793
+ const errors_1 = __webpack_require__(55191);
5793
5794
  async function delayNextStep(attemptsCount, maxAttempts, pollInterval) {
5794
5795
  attemptsCount++;
5795
5796
  checkPollingAttempts(maxAttempts)(attemptsCount);
@@ -5813,6 +5814,12 @@ function extractResolutionMetaFromScanResult({ name, target, identity, policy, t
5813
5814
  };
5814
5815
  }
5815
5816
  exports.extractResolutionMetaFromScanResult = extractResolutionMetaFromScanResult;
5817
+ function handleProcessingStatus(response) {
5818
+ if ((response === null || response === void 0 ? void 0 : response.status) === 'CANCELLED' || (response === null || response === void 0 ? void 0 : response.status) === 'ERROR') {
5819
+ throw new errors_1.FailedToRunTestError('Failed to process the project. Please run the command again with the `-d` flag and contact support@snyk.io with the contents of the output');
5820
+ }
5821
+ }
5822
+ exports.handleProcessingStatus = handleProcessingStatus;
5816
5823
 
5817
5824
 
5818
5825
  /***/ }),
@@ -5874,6 +5881,7 @@ async function pollingMonitorWithTokenUntilDone(token, isAsync, options, pollInt
5874
5881
  },
5875
5882
  };
5876
5883
  const response = await promise_1.makeRequest(payload);
5884
+ common_2.handleProcessingStatus(response);
5877
5885
  if (response.ok && response.isMonitored) {
5878
5886
  return response;
5879
5887
  }
@@ -5928,6 +5936,7 @@ async function pollingTestWithTokenUntilDone(token, type, options, pollInterval,
5928
5936
  qs: { ...common_1.assembleQueryString(options), type },
5929
5937
  };
5930
5938
  const response = await promise_1.makeRequest(payload);
5939
+ common_2.handleProcessingStatus(response);
5931
5940
  if (response.result) {
5932
5941
  const { issues, issuesData, depGraphData, depsFilePaths, fileSignaturesDetails, } = response.result;
5933
5942
  return {