Skip to content

Commit

Permalink
fix: handle error from pnpm FF check (#5348)
Browse files Browse the repository at this point in the history
  • Loading branch information
gemaxim authored Jun 27, 2024
1 parent 715c5bf commit 68ffb2b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/cli/commands/monitor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,15 @@ export default async function monitor(...args0: MethodArgs): Promise<any> {
);
}

const hasPnpmSupport = await hasFeatureFlag(PNPM_FEATURE_FLAG, options);
let hasPnpmSupport = false;
try {
hasPnpmSupport = (await hasFeatureFlag(
PNPM_FEATURE_FLAG,
options,
)) as boolean;
} catch (err) {
hasPnpmSupport = false;
}

const featureFlags = hasPnpmSupport
? new Set<string>([PNPM_FEATURE_FLAG])
Expand Down
8 changes: 6 additions & 2 deletions src/lib/snyk-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ async function test(root, options, callback) {
}

async function executeTest(root, options) {
let hasPnpmSupport = false;
try {
hasPnpmSupport = await hasFeatureFlag(PNPM_FEATURE_FLAG, options);
} catch (err) {
hasPnpmSupport = false;
}
try {
const hasPnpmSupport = await hasFeatureFlag(PNPM_FEATURE_FLAG, options);

const featureFlags = hasPnpmSupport
? new Set([PNPM_FEATURE_FLAG])
: new Set([]);
Expand Down

0 comments on commit 68ffb2b

Please sign in to comment.