throwIf function
Throws an Error if predicate test
is satisfied
Example:
throwIf(n < 1, () => ArgumentError("n must be greater than 0"));
Implementation
void throwIf(bool test, Error Function() errorFactoryFunc) {
return throwIfNot(!test, errorFactoryFunc);
}