Produces a consistently formatted error message and stops execution.
Intended for use inside custom validation steps created with
require_custom(), so they produce the same structured errors as built-in
steps.
Value
No return value. Called for its side effect: it signals a classed
restrictR_failure condition (an error) carrying path, message, and
the optional found and at details.
Examples
# fail() signals an error; wrap in try() to show the formatted message
try(fail("x", "must be positive", found = -3, at = 2L))
#> Error : x: must be positive
#> Found: -3
#> At: 2