Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add special error message app for installs in preprod envs #64

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/api/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ export const installAppIdOnOrgId = async (orgId: string): Promise<AppInstallResp
logger.debug({url: req.url, statusCode: response.statusCode, response: response.body}, 'Response')
return JSON.parse(response.body)
} catch (error: any) {
if (error.includes('HTTP 404: Not Found: app not found')) {
throw new Error(`Unable to find the app ID.
For pre-prod environments, set the environment variable SNYK_BROKER_APP_ID=921020b6-b167-426e-867b-3e2856a2f56e.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: can't we be smart about this and switch to the alternative app id based on the Snyk domain?

For snykgov environments, please contact support.
`)
}
throw new Error(error)
}
}
Expand Down