diff options
author | Veetaha <[email protected]> | 2020-02-28 22:02:19 +0000 |
---|---|---|
committer | Veetaha <[email protected]> | 2020-02-28 22:02:19 +0000 |
commit | b88887e70e0936132b03d8db065b7cf7db175f7b (patch) | |
tree | ac2077aa667f7b7297ff1dbc58558ee233b43fa7 /editors/code | |
parent | 1b9ab04d4b4694eb32402daf83f8df5f13df23ec (diff) |
vscode: add error loging on failed assertion
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/src/util.ts | 7 |
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"; | |||
3 | import { strict as nodeAssert } from "assert"; | 3 | import { strict as nodeAssert } from "assert"; |
4 | 4 | ||
5 | export function assert(condition: unknown, explanation: string): asserts condition { | 5 | export 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 | ||
9 | export const log = { | 14 | export const log = { |