You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made the mistake not to include some of the named elements & was met with a very strange error it took me a while to figure out:
Error in as.character(.transformer(expr, env)) :
cannot coerce type 'closure' to vector of type 'character'
This is because my input was actually a named function (and even though closure should have been a dead giveaway on this I spent 10 minutes + debugging):
glue::glue_data(list(x = 1), '{x} cannot be bigger than {stop}')
I'm not sure any easy way to fix this/give a more helpful message, but if so it could save time debugging.
The text was updated successfully, but these errors were encountered:
We will look into this during the Tidy dev day at RStudio::conf.
I think the easiest way to fix it would be to have glue use a small wrapper around as.character() which provides a more informative error message than the default when the coercion fails.
We now test if the string is a function and throw an error if so, with the caveat that crayon functions can be coerced to characters with `as.character()` (and are in the vignette) so we only error if that coercion fails.
Fixes#114
I made the mistake not to include some of the named elements & was met with a very strange error it took me a while to figure out:
This is because my input was actually a named function (and even though
closure
should have been a dead giveaway on this I spent 10 minutes + debugging):I'm not sure any easy way to fix this/give a more helpful message, but if so it could save time debugging.
The text was updated successfully, but these errors were encountered: