Skip to content

Commit 3782284

Browse files
committed
fix: pass commandBase through to resolveNumericIssue error hints
resolveNumericIssue hardcoded 'sentry issue' in its 404 error hints. Now accepts commandBase param (default: 'sentry issue') so that 'sentry event list 999' shows 'sentry event list <org>/999' in errors instead of 'sentry issue list <org>/999'.
1 parent 4c088dc commit 3782284

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/commands/issue/utils.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,8 @@ function extractOrgFromPermalink(
500500
async function resolveNumericIssue(
501501
id: string,
502502
cwd: string,
503-
command: string
503+
command: string,
504+
commandBase = "sentry issue"
504505
): Promise<ResolvedIssueResult> {
505506
const resolvedOrg = await resolveOrg({ cwd });
506507
try {
@@ -521,10 +522,10 @@ async function resolveNumericIssue(
521522
// group IDs with short-ID suffixes. When org context is available, use
522523
// the real org slug instead of <org> placeholder (CLI-BT, 18 users).
523524
const orgHint = resolvedOrg?.org ?? "<org>";
524-
const hint = `sentry issue ${command} ${orgHint}/${id}`;
525+
const hint = `${commandBase} ${command} ${orgHint}/${id}`;
525526
throw new ResolutionError(`Issue ${id}`, "not found", hint, [
526527
`No issue with numeric ID ${id} found — you may not have access, or it may have been deleted.`,
527-
`If this is a short ID suffix, try: sentry issue ${command} <project>-${id}`,
528+
`If this is a short ID suffix, try: ${commandBase} ${command} <project>-${id}`,
528529
]);
529530
}
530531
throw err;
@@ -559,7 +560,7 @@ export async function resolveIssue(
559560

560561
switch (parsed.type) {
561562
case "numeric":
562-
result = await resolveNumericIssue(parsed.id, cwd, command);
563+
result = await resolveNumericIssue(parsed.id, cwd, command, commandBase);
563564
break;
564565

565566
case "explicit": {

0 commit comments

Comments
 (0)