Skip to content

Commit 377a222

Browse files
committed
fix: restore org-only usage hint format and use explicit org/project in tip
- Revert ContextError usage hint to `sentry event view ${org}/ ${eventId}` (the space after the trailing slash is intentional — it represents <org>/<no_project> <event_id> format) - Change stderr tip from env var guidance to the explicit command form: `Use: sentry event view ${org}/${project} ${eventId}`
1 parent 0ae1789 commit 377a222

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/commands/event/view.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export async function resolveOrgAllTarget(
223223
if (!resolved) {
224224
throw new ContextError(
225225
`Event ${eventId} in organization "${org}"`,
226-
`sentry event view ${org}/${eventId}`
226+
`sentry event view ${org}/ ${eventId}`
227227
);
228228
}
229229
return {
@@ -254,7 +254,7 @@ export async function resolveAutoDetectTarget(
254254
if (resolved) {
255255
stderr.write(
256256
`Tip: Found event in ${resolved.org}/${resolved.project}. ` +
257-
`Set SENTRY_ORG=${resolved.org} and SENTRY_PROJECT=${resolved.project} to skip this search.\n`
257+
`Use: sentry event view ${resolved.org}/${resolved.project} ${eventId}\n`
258258
);
259259
return {
260260
org: resolved.org,

test/commands/event/view.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ describe("resolveAutoDetectTarget", () => {
623623
expect(mockStderr.write).toHaveBeenCalledTimes(1);
624624
const hint = mockStderr.write.mock.calls[0][0] as string;
625625
expect(hint).toContain("acme/frontend");
626-
expect(hint).toContain("SENTRY_ORG=acme");
626+
expect(hint).toContain("sentry event view acme/frontend");
627627
});
628628

629629
test("returns null when both auto-detect and cross-project fail", async () => {

0 commit comments

Comments
 (0)