rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
84 lines (43 loc) • 1.15 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [rc-js-util](./rc-js-util.md) > [\_Debug](./rc-js-util._debug.md) > [error](./rc-js-util._debug.error.md)
## \_Debug.error() method
Throws an `Error` with the given message.
**Signature:**
```typescript
static error(this: void, message: string): boolean;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
this
</td><td>
void
</td><td>
</td></tr>
<tr><td>
message
</td><td>
string
</td><td>
</td></tr>
</tbody></table>
**Returns:**
boolean
A boolean value to make linting happy... will never return.
## Remarks
If `_BUILD.DEBUG` is true and `_BUILD.DISABLE_BREAKPOINT` is false or unset then a breakpoint will be hit first.
## Example
```typescript
if (errorCondition) {
// in debug mode we error
_BUILD.DEBUG && _Debug.error("oopsy");
// in production we fall back to some other behavior
return errorConditionValue;
}
```