InvariantError
Hierarchy
- Readonly<Error & { cause: unknown; message: string; name: InvariantError; stack: string } & { name: InvariantError }>
- InvariantError
Index
Constructors
constructor
Error constructor
Properties
staticreadonlyerrorName
Error name
Methods
staticasString
Static method to convert an error to a string
statichasInstance
Return true if anyValue is an instance of current class
Type parameters
- Class: new (...args: any) => any
The InvariantError object indicates an error that the program violates a fundamental assumption or condition. This exception is typically used to indicate bugs in the code, such as incorrect assumptions about the state of an object or function. The InvariantError object should be thrown when a violation of an invariant occurs and should not be caught by the program. Instead, it should be handled by the program's error handling mechanism.