diff --git a/sources/Engine.ts b/sources/Engine.ts index d1c82145..f17c1552 100644 --- a/sources/Engine.ts +++ b/sources/Engine.ts @@ -10,7 +10,6 @@ import defaultConfig from '../config.js import * as corepackUtils from './corepackUtils'; import * as debugUtils from './debugUtils'; import * as folderUtils from './folderUtils'; -import * as miscUtils from './miscUtils'; import type {NodeError} from './nodeUtils'; import * as semverUtils from './semverUtils'; import * as specUtils from './specUtils'; @@ -289,7 +288,7 @@ export class Engine { } } - async executePackageManagerRequest({packageManager, binaryName, binaryVersion}: PackageManagerRequest, {cwd, args}: {cwd: string, args: Array}): Promise { + async executePackageManagerRequest({packageManager, binaryName, binaryVersion}: PackageManagerRequest, {cwd, args}: {cwd: string, args: Array}): Promise { let fallbackLocator: Locator = { name: binaryName as SupportedPackageManagers, reference: undefined as any, @@ -320,16 +319,7 @@ export class Engine { }; } - let descriptor: Descriptor; - try { - descriptor = await this.findProjectSpec(cwd, fallbackLocator, {transparent: isTransparentCommand}); - } catch (err) { - if (err instanceof miscUtils.Cancellation) { - return 1; - } else { - throw err; - } - } + const descriptor = await this.findProjectSpec(cwd, fallbackLocator, {transparent: isTransparentCommand}); if (binaryVersion) descriptor.range = binaryVersion; diff --git a/sources/miscUtils.ts b/sources/miscUtils.ts deleted file mode 100644 index 83a6dcb1..00000000 --- a/sources/miscUtils.ts +++ /dev/null @@ -1,5 +0,0 @@ -export class Cancellation extends Error { - constructor() { - super(`Cancelled operation`); - } -}