mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 15:14:32 +00:00
vscode: add error loging on failed assertion
This commit is contained in:
parent
1b9ab04d4b
commit
b88887e70e
1 changed files with 6 additions and 1 deletions
|
@ -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 a new issue