Set unexpected error handler on startup

Fixes #911.
This commit is contained in:
Asher 2019-08-15 15:53:20 -05:00
parent d1662d7658
commit f61a0ae78a
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A

View File

@ -1,5 +1,6 @@
import * as cp from "child_process"; import * as cp from "child_process";
import * as os from "os"; import * as os from "os";
import { setUnexpectedErrorHandler } from "vs/base/common/errors";
import { main as vsCli } from "vs/code/node/cliProcessMain"; import { main as vsCli } from "vs/code/node/cliProcessMain";
import { validatePaths } from "vs/code/node/paths"; import { validatePaths } from "vs/code/node/paths";
import { ParsedArgs } from "vs/platform/environment/common/environment"; import { ParsedArgs } from "vs/platform/environment/common/environment";
@ -13,6 +14,7 @@ import { MainServer } from "vs/server/src/server";
import { AuthType, buildAllowedMessage, enumToArray, generateCertificate, generatePassword, localRequire, open, unpackExecutables } from "vs/server/src/util"; import { AuthType, buildAllowedMessage, enumToArray, generateCertificate, generatePassword, localRequire, open, unpackExecutables } from "vs/server/src/util";
const { logger } = localRequire<typeof import("@coder/logger/out/index")>("@coder/logger/out/index"); const { logger } = localRequire<typeof import("@coder/logger/out/index")>("@coder/logger/out/index");
setUnexpectedErrorHandler((error) => logger.warn(error.message));
interface Args extends ParsedArgs { interface Args extends ParsedArgs {
auth?: AuthType; auth?: AuthType;