js-util

Home > rc-js-util > _Debug > error

_Debug.error() method

Throws an Error with the given message.

Signature:

static error(this: void, message: string): boolean;

Parameters

Parameter Type Description
this void  
message string  

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

if (errorCondition) {
    // in debug mode we error
    _BUILD.DEBUG && _Debug.error("oopsy");
    // in production we fall back to some other behavior
    return errorConditionValue;
}