| pkg_abort | R Documentation |
A wrapper around cli::cli_abort() to throw classed errors, with an
opinionated framework of error classes.
pkg_abort(
package,
message,
subclass,
call = caller_env(),
message_env = call,
parent = NULL,
...
)
package |
|
message |
( |
subclass |
( |
call |
|
message_env |
( |
parent |
A parent condition, as you might create during a
|
... |
Additional parameters passed to |
try(pkg_abort("stbl", "This is a test error", "test_subclass"))
tryCatch(
pkg_abort("stbl", "This is a test error", "test_subclass"),
`stbl-error` = function(e) {
"Caught a generic stbl error."
}
)
tryCatch(
pkg_abort("stbl", "This is a test error", "test_subclass"),
`stbl-error-test_subclass` = function(e) {
"Caught a specific subclass of stbl error."
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.