@xliic/cicd-core-node
Advanced tools
Comparing version 5.8.0 to 5.8.1
@@ -35,8 +35,14 @@ "use strict"; | ||
function handleTaskError(err, options) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
if (err instanceof TaskError) { | ||
throw err; | ||
} | ||
else if (err instanceof got_1.HTTPError && ((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.statusCode) === 401) { | ||
throw new TaskError(`Received 'Unauthorized' response to an API call. Check that the API token is correct. See the config instructions ${options.onboardingUrl} or contact support@42crunch.com for support.`); | ||
else if (err instanceof got_1.HTTPError) { | ||
const transactionId = ((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b["x-42c-transactionid"]); | ||
if (((_c = err === null || err === void 0 ? void 0 : err.response) === null || _c === void 0 ? void 0 : _c.statusCode) === 401) { | ||
throw new TaskError(`Received 'Unauthorized' response to an API call. Check that the API token is correct. See the config instructions ${options.onboardingUrl} or contact support@42crunch.com for support. Transaction ID: ${transactionId}`); | ||
} | ||
else { | ||
throw new TaskError(`Unexpected HTTP response ${err.response.statusCode}, transaction ID: ${transactionId}: ${JSON.stringify((_d = err === null || err === void 0 ? void 0 : err.response) === null || _d === void 0 ? void 0 : _d.body)}`); | ||
} | ||
} | ||
@@ -47,5 +53,5 @@ else if (err instanceof config_1.ConfigError) { | ||
else { | ||
throw new TaskError(`Unexpected exception "${err.message} ${err.response ? JSON.stringify((_b = err === null || err === void 0 ? void 0 : err.response) === null || _b === void 0 ? void 0 : _b.body) : ""}"`); | ||
throw new TaskError(`Unexpected exception "${err.message}"`); | ||
} | ||
} | ||
exports.handleTaskError = handleTaskError; |
{ | ||
"name": "@xliic/cicd-core-node", | ||
"version": "5.8.0", | ||
"version": "5.8.1", | ||
"description": "Performs API contract security audit to get a detailed analysis of the possible vulnerabilities and other issues in the API contract.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110015
2505