"Fossies" - the Fresh Open Source Software Archive

Member "cli-1.1280.1/packages/snyk-fix/src/lib/errors/custom-error.ts" (20 Feb 2024, 506 Bytes) of package /linux/misc/snyk-cli-1.1280.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 export class CustomError extends Error {
    2   public innerError?: Error;
    3   public errorCode: string;
    4 
    5   public constructor(message: string, errorCode: ERROR_CODES) {
    6     super(message);
    7     this.name = this.constructor.name;
    8     this.innerError = undefined;
    9     this.errorCode = errorCode;
   10   }
   11 }
   12 
   13 export enum ERROR_CODES {
   14   UnsupportedTypeError = 'G10',
   15   MissingRemediationData = 'G11',
   16   MissingFileName = 'G12',
   17   FailedToParseManifest = 'G13',
   18   CommandFailed = 'G14',
   19   NoFixesCouldBeApplied = 'G15',
   20 }