Skip to contents

Signal an error, warning, or message with cli formatting

Usage

abort(x, call = TRUE)

inform(x)

warn(x)

Arguments

x

character or condition (i.e. returned from stop or warning).

call

logical(1). Include call information in the return message.

Value

Console output, with invisible return of x input.

Note

Updated 2023-02-08.

Examples

x <- "hello world"
try({
    abort(x)
})
#> Error in abort(x) : hello world
try({
    warn(x)
})
#> Warning: hello world
inform(x)
#> hello world