vscode: add error loging on failed assertion

This commit is contained in:
Veetaha 2020-02-29 00:02:19 +02:00
parent 1b9ab04d4b
commit b88887e70e

View file

@ -3,7 +3,12 @@ import * as vscode from "vscode";
import { strict as nodeAssert } from "assert";
export function assert(condition: unknown, explanation: string): asserts condition {
nodeAssert(condition, explanation);
try {
nodeAssert(condition, explanation);
} catch (err) {
log.error(`Assertion failed:`, explanation);
throw err;
}
}
export const log = {