Skip to content

Commit c8df899

Browse files
committed
Add more links to error message
1 parent a56504b commit c8df899

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/commands/scan/perform-reachability-analysis.mts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import terminalLink from 'terminal-link'
2+
13
import constants from '../../constants.mts'
24
import { handleApiCall } from '../../utils/api.mts'
35
import {
46
extractTier1ReachabilityScanId,
57
spawnCoana,
68
} from '../../utils/coana.mts'
7-
import { hasOrgEnterprisePlan } from '../../utils/organization.mts'
9+
import { hasEnterpriseOrgPlan } from '../../utils/organization.mts'
810
import { setupSdk } from '../../utils/sdk.mts'
911
import { fetchOrganization } from '../organization/fetch-organization-list.mts'
1012

@@ -63,12 +65,11 @@ export async function performReachabilityAnalysis(
6365

6466
const { organizations } = orgsCResult.data
6567

66-
if (!hasOrgEnterprisePlan(organizations)) {
68+
if (!hasEnterpriseOrgPlan(organizations)) {
6769
return {
6870
ok: false,
6971
message: 'Tier 1 Reachability analysis requires an enterprise plan',
70-
cause:
71-
'This feature is only available for organizations with an enterprise plan. Please visit https://socket.dev/pricing to upgrade your plan.',
72+
cause: `This feature is only available for organizations with an enterprise plan. Please ${terminalLink('upgrade your plan', 'https://socket.dev/pricing')}.`,
7273
}
7374
}
7475

src/utils/organization.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ export function getOrgSlugs(orgs: Organizations): string[] {
1313
return orgs.map(o => o.slug)
1414
}
1515

16-
export function hasOrgEnterprisePlan(orgs: Organizations): boolean {
16+
export function hasEnterpriseOrgPlan(orgs: Organizations): boolean {
1717
return orgs.some(o => o.plan === 'enterprise')
1818
}

0 commit comments

Comments
 (0)