A wrapper around rlang::inform() for providing feedback to developers using
this packages functions.
Arguments
- ...
Arguments passed on to
rlang::informmessageThe message to display, formatted as a bulleted list. The first element is displayed as an alert bullet prefixed with
!by default. Elements named"*","i","v","x", and"!"are formatted as regular, info, success, failure, and error bullets respectively. See Formatting messages with cli for more about bulleted messaging.If a message is not supplied, it is expected that the message is generated lazily through
cnd_header()andcnd_body()methods. In that case,classmust be supplied. Onlyinform()allows empty messages as it is occasionally useful to build user output incrementally.If a function, it is stored in the
headerfield of the error condition. This acts as acnd_header()method that is invoked lazily when the error message is displayed.classSubclass of the condition.
body,footerAdditional bullets.
parentSupply
parentwhen you rethrow an error from a condition handler (e.g. withtry_fetch()).If
parentis a condition object, a chained error is created, which is useful when you want to enhance an error with more details, while still retaining the original information.If
parentisNA, it indicates an unchained rethrow, which is useful when you want to take ownership over an error and rethrow it with a custom message that better fits the surrounding context.Technically, supplying
NAletsabort()know it is called from a condition handler. This helps it create simpler backtraces where the condition handling context is hidden by default.
For more information about error calls, see Including contextual information with error chains.
use_cli_formatWhether to format
messagelazily using cli if available. This results in prettier and more accurate formatting of messages. Seelocal_use_cli()to set this condition field by default in your package namespace.If set to
TRUE,messageshould be a character vector of individual and unformatted lines. Any newline character"\\n"already present inmessageis reformatted by cli's paragraph formatter. See Formatting messages with cli..inheritWhether the condition inherits from
parentaccording tocnd_inherits()andtry_fetch(). By default, parent conditions of higher severity are not inherited. For instance an error chained to a warning is not inherited to avoid unexpectedly catching an error downgraded to a warning..fileA connection or a string specifying where to print the message. The default depends on the context, see the
stdoutvsstderrsection..subclassThis argument was renamed to
classin rlang 0.4.2 for consistency with our conventions for class constructors documented in https://adv-r.hadley.nz/s3.html#s3-subclassing..frequencyHow frequently should the warning or message be displayed? By default (
"always") it is displayed at each time. If"regularly", it is displayed once every 8 hours. If"once", it is displayed once per session..frequency_idA unique identifier for the warning or message. This is used when
.frequencyis supplied to recognise recurring conditions. This argument must be supplied if.frequencyis not set to"always".