Skip to contents

[Stable]

If the provided object is a Success then the function will 'panic' and throw an error of class expect_fail_panic, with the message body set to msg.

Usage

unwrap_fail(x, ...)

Arguments

x

The object to unwrap.

...

Additional optional arguments that may be used by specific methods.

Value

The error wrapped by x if a condition was not thrown as result of a Success value.

See also

unwrap() to unwrap the value of a Success instead.

Examples

Failure("Oh no I failed because of bad parameters") |> unwrap_fail()
#> [1] "Oh no I failed because of bad parameters"
if (FALSE) { # \dontrun{
Success(10) |> unwrap_fail()
} # }