From b88887e70e0936132b03d8db065b7cf7db175f7b Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sat, 29 Feb 2020 00:02:19 +0200 Subject: vscode: add error loging on failed assertion --- editors/code/src/util.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'editors/code') diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts index acf78898b..203494459 100644 --- a/editors/code/src/util.ts +++ b/editors/code/src/util.ts @@ -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 = { -- cgit v1.2.3