@snyk/error-catalog-nodejs-public
Advanced tools
Comparing version 5.36.1 to 5.37.0
{ | ||
"name": "@snyk/error-catalog-nodejs-public", | ||
"version": "5.36.1", | ||
"version": "5.37.0", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "snyk.io", |
@@ -19,2 +19,22 @@ /* | ||
* @class | ||
* @name GeneralCLIFailureError | ||
* @description The encountered error only provides basic information, please take a look at the given details.If they do not help to resolve the issue, consider debugging or consulting support. | ||
* | ||
* See more: | ||
* - [https://docs.snyk.io/snyk-cli/commands](https://docs.snyk.io/snyk-cli/commands) | ||
* - [https://docs.snyk.io/snyk-cli/debugging-the-snyk-cli](https://docs.snyk.io/snyk-cli/debugging-the-snyk-cli) | ||
* @summary Unspecified Error | ||
* @category CLI | ||
* @param {string} details the specific details that causes this error | ||
* @param {string} description the general description for this error | ||
* @param {Classification} classification the error classification determining if the error is user-actionable or not | ||
* @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error | ||
* @param {Error} [cause] the `Error` type that caused this error to be thrown | ||
* @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata | ||
*/ | ||
export declare class GeneralCLIFailureError extends ProblemError { | ||
constructor(details: string, additionalData?: Record<string, any>, cause?: Error, instance?: string, logs?: string[]); | ||
} | ||
/** | ||
* @class | ||
* @name ConfigEnvironmentFailedError | ||
@@ -21,0 +41,0 @@ * @description The specified environment cannot be used. As a result, the configuration remains unchanged.Provide the correct specifications for the environment and try again. |
@@ -18,3 +18,3 @@ /* | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ConnectionTimeoutError = exports.ConfigEnvironmentConsistencyIssueError = exports.ConfigEnvironmentFailedError = void 0; | ||
exports.ConnectionTimeoutError = exports.ConfigEnvironmentConsistencyIssueError = exports.ConfigEnvironmentFailedError = exports.GeneralCLIFailureError = void 0; | ||
const types_1 = require("../types"); | ||
@@ -24,2 +24,38 @@ const problem_error_1 = require("../problem-error"); | ||
* @class | ||
* @name GeneralCLIFailureError | ||
* @description The encountered error only provides basic information, please take a look at the given details.If they do not help to resolve the issue, consider debugging or consulting support. | ||
* | ||
* See more: | ||
* - [https://docs.snyk.io/snyk-cli/commands](https://docs.snyk.io/snyk-cli/commands) | ||
* - [https://docs.snyk.io/snyk-cli/debugging-the-snyk-cli](https://docs.snyk.io/snyk-cli/debugging-the-snyk-cli) | ||
* @summary Unspecified Error | ||
* @category CLI | ||
* @param {string} details the specific details that causes this error | ||
* @param {string} description the general description for this error | ||
* @param {Classification} classification the error classification determining if the error is user-actionable or not | ||
* @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error | ||
* @param {Error} [cause] the `Error` type that caused this error to be thrown | ||
* @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata | ||
*/ | ||
class GeneralCLIFailureError extends problem_error_1.ProblemError { | ||
constructor(details, additionalData, cause, instance, logs) { | ||
super({ | ||
title: 'Unspecified Error', | ||
type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-cli-0000', | ||
status: 200, | ||
description: `The encountered error only provides basic information, please take a look at the given details.If they do not help to resolve the issue, consider debugging or consulting support.`, | ||
errorCode: 'SNYK-CLI-0000', | ||
level: 'error', | ||
classification: types_1.Classification.UNEXPECTED, | ||
instance, | ||
}, details, Object.assign({ links: [ | ||
'https://docs.snyk.io/snyk-cli/commands', | ||
'https://docs.snyk.io/snyk-cli/debugging-the-snyk-cli', | ||
] }, additionalData), cause, logs); | ||
this.name = this.constructor.name; | ||
} | ||
} | ||
exports.GeneralCLIFailureError = GeneralCLIFailureError; | ||
/** | ||
* @class | ||
* @name ConfigEnvironmentFailedError | ||
@@ -26,0 +62,0 @@ * @description The specified environment cannot be used. As a result, the configuration remains unchanged.Provide the correct specifications for the environment and try again. |
@@ -239,2 +239,3 @@ /* | ||
CLI: { | ||
GeneralCLIFailure: string; | ||
ConfigEnvironmentFailed: string; | ||
@@ -241,0 +242,0 @@ ConfigEnvironmentConsistencyIssue: string; |
@@ -241,2 +241,3 @@ /* | ||
CLI: { | ||
GeneralCLIFailure: 'SNYK-CLI-0000', | ||
ConfigEnvironmentFailed: 'SNYK-CLI-0001', | ||
@@ -243,0 +244,0 @@ ConfigEnvironmentConsistencyIssue: 'SNYK-CLI-0002', |
@@ -55,3 +55,3 @@ /* | ||
toProblemJson(instance) { | ||
const payload = Object.assign({ type: this.metadata.type, title: this.metadata.title, description: this.metadata.description, status: this.metadata.status, errorCode: this.metadata.errorCode, detail: this.detail, classification: this.metadata.classification, instance, logs: this.logs }, this.additionalData); | ||
const payload = Object.assign({ type: this.metadata.type, title: this.metadata.title, description: this.metadata.description, status: this.metadata.status, errorCode: this.metadata.errorCode, level: this.metadata.level, detail: this.detail, classification: this.metadata.classification, instance, logs: this.logs }, this.additionalData); | ||
return new types_1.ProblemJson(payload); | ||
@@ -81,3 +81,3 @@ } | ||
detail: this.detail, | ||
meta: Object.assign(Object.assign({}, this.additionalData), { isErrorCatalogError: true, classification: this.metadata.classification }), | ||
meta: Object.assign(Object.assign({}, this.additionalData), { isErrorCatalogError: true, classification: this.metadata.classification, level: this.metadata.level }), | ||
}; | ||
@@ -126,2 +126,3 @@ if (source) { | ||
type: (_a = obj.links) === null || _a === void 0 ? void 0 : _a.about, | ||
level: obj.meta.level, | ||
status: Number(obj.status), | ||
@@ -128,0 +129,0 @@ classification: obj.meta.classification, |
@@ -29,3 +29,3 @@ /* | ||
instance?: string; | ||
level?: string; | ||
level: string; | ||
classification: Classification; | ||
@@ -69,2 +69,3 @@ [x: string]: any; | ||
isErrorCatalogError: boolean; | ||
level?: string; | ||
classification?: Classification; | ||
@@ -71,0 +72,0 @@ logs?: string[]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
940290
13697