mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +00:00
vscode: add error loging on failed assertion
This commit is contained in:
parent
1b9ab04d4b
commit
b88887e70e
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user