Skip to content

Commit

Permalink
sc-8099: ensure env are set in sentry set up (#821)
Browse files Browse the repository at this point in the history
* refac: ensure env are set in sentry set up

* minor fixes

* clean up
  • Loading branch information
masskoder authored Oct 17, 2022
1 parent 31e7ae3 commit b020ed7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion web/gds-admin-ui/src/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import config from './config';
const defaultTracingOrigins = ['localhost', /^\//];

const initSentry = () => {
console.log(config.appVersion)
// ensure environment variables app version and git revision are set
if (!config.appVersion) {
throw new Error('App version is not set in environment variables');
}
if (!config.gitVersion) {
throw new Error('Git revision is not set in environment variables');
}
console.log(`AppVersion: ${config.appVersion || 'not set'} - GitRevision: ${config.gitVersion || 'not set'}`); // eslint-disable-line no-console

if (process.env.REACT_APP_SENTRY_DSN) {
let tracingOrigins = defaultTracingOrigins;
Expand Down
4 changes: 2 additions & 2 deletions web/gds-user-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
"extract": "lingui extract",
"compile": "lingui compile",
"extract-c": "lingui extract --clean",
"dash": "node write-save-po-file.js",
"dash-compile": "node write-save-po-file.js && lingui compile",
"dash": "node scripts/write-save-po-file.js",
"dash-compile": "node scripts/write-save-po-file.js && lingui compile",
"analyze": "source-map-explorer 'build/static/js/*.js'"
},
"lint-staged": {
Expand Down
File renamed without changes.

0 comments on commit b020ed7

Please sign in to comment.