We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b55aaf2 commit a317db0Copy full SHA for a317db0
packages/langium/src/utils/errors.ts
@@ -12,6 +12,12 @@ export class ErrorWithLocation extends Error {
12
}
13
14
15
-export function assertUnreachable(_: never): never {
16
- throw new Error('Error! The input value was not handled.');
+export function assertUnreachable(_: never, message = 'Error: Got unexpected value.'): never {
+ throw new Error(message);
17
+}
18
+
19
+export function assertCondition(condition: boolean, message: string = 'Error: Condition is violated.'): asserts condition {
20
+ if (!condition) {
21
22
+ }
23
0 commit comments