From 3f646ec970d71047dbf29a7a2cb4037432c8b7de Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 7 Sep 2026 12:10:00 +0000 Subject: [PATCH] fix(org): log region URL parse failures in org list instead of silently returning "?" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The getRegionDisplayName function catches URL parsing errors silently, returning "?" with no diagnostic output. When users see "?" in the region column, there is no way to determine which region URL was malformed. Add log.debug() to surface the failing URL and error, and remove the grandfathered biome-ignore suppression. Co-authored-by: Miguel Betegón --- packages/cli/src/commands/org/list.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/org/list.ts b/packages/cli/src/commands/org/list.ts index c4eb56395..f16e2dfff 100644 --- a/packages/cli/src/commands/org/list.ts +++ b/packages/cli/src/commands/org/list.ts @@ -18,6 +18,7 @@ import { FRESH_ALIASES, FRESH_FLAG, } from "../../lib/list-command.js"; +import { logger } from "../../lib/logger.js"; import { withProgress } from "../../lib/polling.js"; import type { SentryOrganization, Writer } from "../../types/index.js"; @@ -46,8 +47,9 @@ type OrgListEntry = SentryOrganization & { region?: string }; * @example "https://de.sentry.io" -> "EU" * @example "https://east-1.us.sentry.io" -> "EAST-1.US" */ +const log = logger.withTag("org.list"); + function getRegionDisplayName(regionUrl: string): string { - // biome-ignore lint/plugin: grandfathered silent catch — see #1531; drain by adding log.debug()/log.warn() or re-throwing. try { const url = new URL(regionUrl); const { hostname } = url; @@ -69,7 +71,8 @@ function getRegionDisplayName(regionUrl: string): string { sentry: "US", // sentry.io defaults to US }; return regionMap[regionPart] ?? regionPart.toUpperCase(); - } catch { + } catch (error) { + log.debug(`Failed to parse region URL "${regionUrl}"`, error); return "?"; } }