mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Update the Sentry setup log with the build type (#13157)
The `environment` field we use for Sentry includes the build type for all build types except `main`, but the log message indicating that Sentry did not include this. This log message is useful for ensuring that Sentry is setup correctly, so it should display the same environment that Sentry is using. It has been updated to do just that.
This commit is contained in:
parent
56a0385e94
commit
fe77367837
@ -72,21 +72,6 @@ export default function setupSentry({ release, getState }) {
|
||||
|
||||
if (METAMASK_DEBUG) {
|
||||
return undefined;
|
||||
} else if (METAMASK_ENVIRONMENT === 'production') {
|
||||
if (!process.env.SENTRY_DSN) {
|
||||
throw new Error(
|
||||
`Missing SENTRY_DSN environment variable in production environment`,
|
||||
);
|
||||
}
|
||||
console.log(
|
||||
`Setting up Sentry Remote Error Reporting for '${METAMASK_ENVIRONMENT}': SENTRY_DSN`,
|
||||
);
|
||||
sentryTarget = process.env.SENTRY_DSN;
|
||||
} else {
|
||||
console.log(
|
||||
`Setting up Sentry Remote Error Reporting for '${METAMASK_ENVIRONMENT}': SENTRY_DSN_DEV`,
|
||||
);
|
||||
sentryTarget = SENTRY_DSN_DEV;
|
||||
}
|
||||
|
||||
const environment =
|
||||
@ -94,6 +79,23 @@ export default function setupSentry({ release, getState }) {
|
||||
? METAMASK_ENVIRONMENT
|
||||
: `${METAMASK_ENVIRONMENT}-${METAMASK_BUILD_TYPE}`;
|
||||
|
||||
if (METAMASK_ENVIRONMENT === 'production') {
|
||||
if (!process.env.SENTRY_DSN) {
|
||||
throw new Error(
|
||||
`Missing SENTRY_DSN environment variable in production environment`,
|
||||
);
|
||||
}
|
||||
console.log(
|
||||
`Setting up Sentry Remote Error Reporting for '${environment}': SENTRY_DSN`,
|
||||
);
|
||||
sentryTarget = process.env.SENTRY_DSN;
|
||||
} else {
|
||||
console.log(
|
||||
`Setting up Sentry Remote Error Reporting for '${environment}': SENTRY_DSN_DEV`,
|
||||
);
|
||||
sentryTarget = SENTRY_DSN_DEV;
|
||||
}
|
||||
|
||||
Sentry.init({
|
||||
dsn: sentryTarget,
|
||||
debug: METAMASK_DEBUG,
|
||||
|
Loading…
Reference in New Issue
Block a user