Skip to content

Commit 0692b82

Browse files
committed
chore: address review comments
1 parent fa19eea commit 0692b82

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

developer/src/kmc/src/util/KeymanSentry.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import Sentry from "@sentry/node";
44
import KEYMAN_VERSION from "@keymanapp/keyman-version";
55
import { spawnChild } from "./spawnAwait.js";
66

7+
/**
8+
* Maximum delay on shutdown of process to send pending events
9+
* to Sentry, in msec
10+
*/
11+
const CLOSE_TIMEOUT = 2000;
12+
713
const cli = process.argv.join(' ');
814
let isInit = false;
915

@@ -39,7 +45,7 @@ export class KeymanSentry {
3945
}
4046
} else if(cli.includes('event')) {
4147
const eventId = Sentry.captureMessage('Test message from -sentry-client-test-exception event');
42-
await Sentry.close(2000);
48+
await Sentry.close(CLOSE_TIMEOUT);
4349
console.log(`Captured test message with id ${eventId}`);
4450
process.exit(0);
4551
} else {

developer/src/kmc/src/util/NodeCompilerCallbacks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ export class NodeCompilerCallbacks implements CompilerCallbacks {
122122

123123
this.messages.push({...event});
124124

125-
// report fatal errors to Sentry, but don't display; note, it won't be
125+
// report fatal errors to Sentry, but don't abort; note, it won't be
126126
// reported if user has disabled the Sentry setting
127127
if(CompilerError.severity(event.code) == CompilerErrorSeverity.Fatal) {
128-
// this is async so returns a Promise, we'll let it resolve
129-
// in its own time, and it can print its message then
128+
// this is async so returns a Promise, we'll let it resolve in its own
129+
// time, and it will emit a message to stderr with details at that time
130130
KeymanSentry.reportException(event.exceptionVar, false);
131131
}
132132

0 commit comments

Comments
 (0)