Skip to content

Commit 436dbe0

Browse files
committed
Report errors to Sentry
1 parent 87674e7 commit 436dbe0

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-0
lines changed

package-lock.json

Lines changed: 124 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@oclif/config": "^1.8.8",
3030
"@oclif/plugin-help": "^2.1.3",
3131
"@oclif/plugin-update": "^1.3.8",
32+
"@sentry/node": "^4.5.0",
3233
"async-mutex": "^0.1.3",
3334
"env-paths": "^1.0.0",
3435
"graphql": "^14.0.2",

src/commands/start.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
import * as Sentry from '@sentry/node';
2+
3+
const packageJson = require('../../package.json');
4+
let { SENTRY_DSN } = process.env;
5+
if (!SENTRY_DSN && process.env.HTTPTOOLKIT_SERVER_BINPATH) {
6+
// If we're a built binary, use the standard DSN automatically
7+
SENTRY_DSN = 'https://[email protected]/1371158';
8+
}
9+
10+
if (SENTRY_DSN) {
11+
Sentry.init({ dsn: SENTRY_DSN, release: packageJson.version });
12+
}
13+
114
import { Command, flags } from '@oclif/command'
215
import { runHTK } from '../index';
316

0 commit comments

Comments
 (0)