cndConditions for cnd
These conditions are made with the {cnd} package though the use of
condition().
cnd:as_character_cnd_error/error{cnd}
cnd:as_character_cnd_error
error
You cannot coerce a condition_generator object to a character. This may have occurred when trying to put a condition function through stop() or warning. Instead, call the function first, then pass the result to stop() or warning().
For example:
# Instead of this
stop(my_condition)# Do this
stop(my_condition())
cnd:cnd_document_conditions/warning{cnd}
cnd:cnd_document_conditions
warning
Documentation will fail when no conditions are found. You may be executing cnd_document() too early, before conditions have been registered. You can try to find your conditions with conditions().
cnd:cnd_document_file/error{cnd}
cnd:cnd_document_file
error
The file argument to cnd_document() must be a file path, a connection object, or NULL to return the documentation as a character vector. The default value should be suitable for standard use cases.
cnd:cnd_document_pkg_reg/error{cnd}
cnd:cnd_document_pkg_reg
error
Both package and registry must be set to document conditions.You can set a registry by adding cnd_create_registry() calls to your package code.
cnd:cnd_generated_cleanup/message{cnd}
cnd:cnd_generated_cleanup
message
Some files created during the documentation process may become obsolete while updating your conditions.
cnd:cnd_generated_write/condition{cnd}
cnd:cnd_generated_write
condition
This condition is signaled when cnd_document() needs to write new documentation files.
cnd:cond_cnd_class/error{cnd}
cnd:cond_cnd_class
error
cnd() simple calls the appropriate function: stop(), warning(), or message() based on the type parameter from condition().
cnd:condition_message_generator/error{cnd}
cnd:condition_message_generator
error
condition_generator objects are not conditions. You may have made this mistake:
x <- condition("my_condition")
conditionMessage(x)
Condition generators need to be called first before they can be used as conditions. Try this instead:
x <- condition("my_condition")
conditionMessage(x())
cnd:condition_overwrite/warning{cnd}
cnd:condition_overwrite
warning
Defining a new condition with the same class and package as an existing condition will overwrite the previous definition. It is recommended to either avoid this by fully defining your condition, or creating a new condition instead.
cnd:conditions_dots/warning{cnd}
cnd:conditions_dots
warning
The ... parameter in conditions() is meant for convenience. Only a single argument is allowed. Other parameters must be named explicitly.
For example:
# Instead of this
conditions("class", "package") # "package" is ignored with a warning# Do this
conditions(class = "class", package = "package")
cnd:invalid_condition/error{cnd}
cnd:invalid_condition
error
The class, exports, and help parameters must be a single character string. If you are passing a function, it must be a valid function.
cnd:invalid_condition_message/error{cnd}
cnd:invalid_condition_message
error
Conditions messages are displayed when invoked through conditionMessage(). You can set a static message by passing through a character vector, or a dynamic message by passing through a function. The function should return a character vector.
When message is not set, a default "there was an error" message is used.
cnd:match_arg/error{cnd}
cnd:match_arg
error
Mostly match.arg() but with a custom condition
cnd:no_package_exports/warning{cnd}
cnd:no_package_exports
warning
The exports parameter requires a package
The following conditions are defined in the {cnd} package.
cnd-package condition