mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-14 12:49:25 +00:00
chore: address review comments
This commit is contained in:
parent
fa19eea873
commit
0692b8200a
2 changed files with 10 additions and 4 deletions
|
|
@ -4,6 +4,12 @@ import Sentry from "@sentry/node";
|
|||
import KEYMAN_VERSION from "@keymanapp/keyman-version";
|
||||
import { spawnChild } from "./spawnAwait.js";
|
||||
|
||||
/**
|
||||
* Maximum delay on shutdown of process to send pending events
|
||||
* to Sentry, in msec
|
||||
*/
|
||||
const CLOSE_TIMEOUT = 2000;
|
||||
|
||||
const cli = process.argv.join(' ');
|
||||
let isInit = false;
|
||||
|
||||
|
|
@ -39,7 +45,7 @@ export class KeymanSentry {
|
|||
}
|
||||
} else if(cli.includes('event')) {
|
||||
const eventId = Sentry.captureMessage('Test message from -sentry-client-test-exception event');
|
||||
await Sentry.close(2000);
|
||||
await Sentry.close(CLOSE_TIMEOUT);
|
||||
console.log(`Captured test message with id ${eventId}`);
|
||||
process.exit(0);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -122,11 +122,11 @@ export class NodeCompilerCallbacks implements CompilerCallbacks {
|
|||
|
||||
this.messages.push({...event});
|
||||
|
||||
// report fatal errors to Sentry, but don't display; note, it won't be
|
||||
// report fatal errors to Sentry, but don't abort; note, it won't be
|
||||
// reported if user has disabled the Sentry setting
|
||||
if(CompilerError.severity(event.code) == CompilerErrorSeverity.Fatal) {
|
||||
// this is async so returns a Promise, we'll let it resolve
|
||||
// in its own time, and it can print its message then
|
||||
// this is async so returns a Promise, we'll let it resolve in its own
|
||||
// time, and it will emit a message to stderr with details at that time
|
||||
KeymanSentry.reportException(event.exceptionVar, false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue