Skip to content

ref(gsAdmin): Convert promo code API call to try/catch - #126261

Closed
sentry[bot] wants to merge 1 commit into
masterfrom
seer/ref-gsadmin-promocode-try-catch
Closed

sentry[bot] wants to merge 1 commit into
masterfrom
seer/ref-gsadmin-promocode-try-catch

Conversation

@sentry

@sentry sentry Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Refactors the promo code API call in static/gsAdmin/views/relocationCreate.tsx from using .requestPromise().catch() to an await requestPromise() within a try/catch block.

This change addresses a false positive reported by the no-callback-api-request coding convention scanner. While the original .catch() pattern is functionally valid and promise-based, the scanner was incorrectly flagging it. Switching to try/catch aligns more explicitly with the scanner's preferred pattern for api.requestPromise calls, preventing future false positives.

The functional behavior of the code remains unchanged, specifically regarding the handling of 403 errors and other potential API errors.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes CODING-CONVENTIONS-3E5

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

@sentry
sentry Bot requested a review from a team as a code owner October 1, 2026 22:43
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 1, 2026
@ryan953 ryan953 self-assigned this Oct 1, 2026
@ryan953 ryan953 added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Oct 1, 2026
@ryan953 ryan953 closed this Oct 2, 2026
@ryan953

ryan953 commented Oct 2, 2026

Copy link
Copy Markdown
Member

dupe with #126272

This branch was successfully deployed

1 active deployment
Preview — aea889aa Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant