aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorVeetaha <[email protected]>2020-02-28 22:02:19 +0000
committerVeetaha <[email protected]>2020-02-28 22:02:19 +0000
commitb88887e70e0936132b03d8db065b7cf7db175f7b (patch)
treeac2077aa667f7b7297ff1dbc58558ee233b43fa7 /editors
parent1b9ab04d4b4694eb32402daf83f8df5f13df23ec (diff)
vscode: add error loging on failed assertion
Diffstat (limited to 'editors')
-rw-r--r--editors/code/src/util.ts7
1 files changed, 6 insertions, 1 deletions
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";
3import { strict as nodeAssert } from "assert"; 3import { strict as nodeAssert } from "assert";
4 4
5export function assert(condition: unknown, explanation: string): asserts condition { 5export function assert(condition: unknown, explanation: string): asserts condition {
6 nodeAssert(condition, explanation); 6 try {
7 nodeAssert(condition, explanation);
8 } catch (err) {
9 log.error(`Assertion failed:`, explanation);
10 throw err;
11 }
7} 12}
8 13
9export const log = { 14export const log = {