"Fossies" - the Fresh Open Source Software Archive

Member "cli-1.1260.0/src/lib/errors/unsupported-package-manager-error.ts" (4 Dec 2023, 730 Bytes) of package /linux/misc/snyk-cli-1.1260.0.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 import { CustomError } from './custom-error';
    2 import * as pms from '../package-managers';
    3 
    4 export class UnsupportedPackageManagerError extends CustomError {
    5   private static ERROR_MESSAGE: string =
    6     'Here are our supported package managers:' +
    7     `${Object.keys(pms.SUPPORTED_PACKAGE_MANAGER_NAME).map(
    8       (i) => '\n  - ' + i + ' (' + pms.SUPPORTED_PACKAGE_MANAGER_NAME[i] + ')',
    9     )}
   10         `;
   11 
   12   constructor(packageManager) {
   13     super(
   14       `Unsupported package manager ${packageManager}.` +
   15         UnsupportedPackageManagerError.ERROR_MESSAGE,
   16     );
   17     this.code = 422;
   18     this.userMessage =
   19       `Unsupported package manager '${packageManager}''. ` +
   20       UnsupportedPackageManagerError.ERROR_MESSAGE;
   21   }
   22 }