internal export enum PluginDiscoveryErrorType { IncompatibleVersion = 'incompatible-version' , InvalidSearchPath = 'invalid-search-path' , InvalidPluginPath = 'invalid-plugin-path' , InvalidManifest = 'invalid-manifest' , MissingManifest = 'missing-manifest' } internal export class PluginDiscoveryError extends Error { public static incompatibleVersion ( path , cause ) { return new PluginDiscoveryError ( PluginDiscoveryErrorType . IncompatibleVersion , path , cause ) ; } public static invalidSearchPath ( path , cause ) { return new PluginDiscoveryError ( PluginDiscoveryErrorType . InvalidSearchPath , path , cause ) ; } public static invalidPluginPath ( path , cause ) { return new PluginDiscoveryError ( PluginDiscoveryErrorType . InvalidPluginPath , path , cause ) ; } public static invalidManifest ( path , cause ) { return new PluginDiscoveryError ( PluginDiscoveryErrorType . InvalidManifest , path , cause ) ; } public static missingManifest ( path , cause ) { return new PluginDiscoveryError ( PluginDiscoveryErrorType . MissingManifest , path , cause ) ; } param type param path param cause constructor ( public readonly type , public readonly path , public readonly cause ) { super ( `${ cause . message } (${ type }, ${ path })` ) ; Object . setPrototypeOf ( this , PluginDiscoveryError . prototype ) ; } }