Skip to content

Commit

Permalink
chore: remove unused Cancellation error (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz committed Mar 15, 2024
1 parent 6054339 commit 47f1e2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
14 changes: 2 additions & 12 deletions sources/Engine.ts
Expand Up @@ -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';
Expand Down Expand Up @@ -289,7 +288,7 @@ export class Engine {
}
}

async executePackageManagerRequest({packageManager, binaryName, binaryVersion}: PackageManagerRequest, {cwd, args}: {cwd: string, args: Array<string>}): Promise<number | void> {
async executePackageManagerRequest({packageManager, binaryName, binaryVersion}: PackageManagerRequest, {cwd, args}: {cwd: string, args: Array<string>}): Promise<void> {
let fallbackLocator: Locator = {
name: binaryName as SupportedPackageManagers,
reference: undefined as any,
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions sources/miscUtils.ts

This file was deleted.

0 comments on commit 47f1e2f

Please sign in to comment.