Closed topepo closed 1 month ago
Don't do the gsub()
s, the correct way to solve this is:
msg <- "Error in if (df < 0) { : missing blah blah\n"
cli::format_error("{msg}")
The rule of thumb is to always pass a string literal to cli functions, never a variable from the user (that's actually a security issue as well!) or even an error message.
Here's an example from tidymodels/recipes#1380
Created on 2024-10-22 with reprex v2.1.0
Happy to add a PR and tests if you suggest where to add gsub's