- changed status to resolved
Issue #18
resolved
To allow handling of individual conditions by tryCatch
, you need to give it a unique ID.
As advised by Luke Tierney and Duncan Murdoch, the ID of an error/warning/message is its class.
Probably need to have a way of autogenerating this class. Possible idea:
From inside assert_engine
, we can do
predicate_name <- get_name_in_parent(predicate) # e.g., "is_in_range" condition_type1 <- paste0( # e.g., "IsInRangeCondition" R.utils::toCamelCase( predicate_name, split = "_" ), "Condition" ) caller_package <- find(predicate_name) # e.g., "package:assertive.numbers" condition_type2 <- paste0( # e.g., "numbersCondition" substring(caller_package, 19), "Condition" ) c(condition_type1, condition_type2)
Ideally though the first condition type ought to be negated. For example, it should be an OutOfRangeCondition
.
Also need the ability to manually push extra classes, for the cases where functions can throw several error types.
Comments (1)
-
reporter - Log in to comment
Fixed in assertive.base https://bitbucket.org/richierocks/assertive.base/commits/fa34b925269a482ee034ff8c894db917e41c0f4f