diff options
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 = { |