import { Extension } from "./extension" ; import { PackageManagerLogEntry } from "./package-manager" ; import { SystemRequirementError } from "./system-requirements" ; export class UnresolvedPackageException extends Error { constructor ( packageId ) { super ( `Unable to resolve package '${ packageId }'.` ) ; Object . setPrototypeOf ( this , UnresolvedPackageException . prototype ) ; } } export class InvalidPackageIdentityException extends Error { constructor ( name , version , message ) { super ( `Package '${ name }' - '${ version }' is not a valid package reference:\n  ${ message }` ) ; Object . setPrototypeOf ( this , InvalidPackageIdentityException . prototype ) ; } } export class PackageInstallationException extends Error { constructor ( name , version , message ) { super ( `Package '${ name }' - '${ version }' failed to install:\n  ${ message }` ) ; Object . setPrototypeOf ( this , PackageInstallationException . prototype ) ; } } export class UnsatisfiedEngineException extends Error { constructor ( name , version , message = "" ) { super ( `Unable to find matching engine '${ name }' - '${ version } ${ message }'` ) ; Object . setPrototypeOf ( this , UnsatisfiedEngineException . prototype ) ; } } export class UnsatisfiedSystemRequirementException extends Error { constructor ( extension , errors ) { const message = [ `System is missing dependencies required by extension '${ extension . name }':` , ... errors . map ( ( x ) => ` - ${ x . name }: ${ x . message . replace ( /\n/g , "\n " ) }` ) , ] . join ( "\n" ) ; super ( message ) ; Object . setPrototypeOf ( this , UnsatisfiedSystemRequirementException . prototype ) ; } } export class MissingStartCommandException extends Error { constructor ( extension ) { super ( `Extension '${ extension . id }' is missing the script 'start' in the package.json file` ) ; Object . setPrototypeOf ( this , MissingStartCommandException . prototype ) ; } } export class ExtensionFolderLocked extends Error { constructor ( path ) { super ( `Extension Folder '${ path }' is locked by another process.` ) ; Object . setPrototypeOf ( this , ExtensionFolderLocked . prototype ) ; } }