Closed
Description
Most or all errors thrown in this package are made via rlang::abort()
. We are transitioning to cli::cli_abort()
to make use of the richer styling options for errors via cli (which calls rlang under the hood).
It is often sufficient to search for and replace the rlang version with the cli version together with adding a little bit of styling.
Some examples of the styling possibilities are in the general introduction under the section of Inline text formatting. More details on inline formatting and pluralization.
One aspect to watch out for when transitioning from rlang::abort()
to cli::cli_abort()
are messages pre-assembled from user input as described here.
#499 can serve as an example.
We are splitting this up into several batches:
- Move to {cli} in aaa_models.R #1091
- switch to {cli} in check_args() functions #1093
- Use ci errors for
R/aaa_models.R
#1136 - Use cli errors in
R/fit.R
#1137 - Use cli errors in
R/predict.R
#1138 - Use cli errors in
R/bart.R
,R/boost_tree.R
,R/decision_tree.R
, andR/gen_additive_mod.R
#1139 - Use cli errors in
R/glmnet-engines.R
,R/logistic_reg.R
,R/mars.R
, andR/mlp.R
#1140 - Use cli errors in
R/predict_class.R
,R/predict_classprob.R
,R/predict_numeric.R
, andR/predict_time.R
#1141 - Use cli errors in
R/nearest_neighbor_data.R
,R/rand_forest_data.R
,R/rand_forest.R
,R/svm_linear.R
, andR/svm_rbf_data.R
#1142