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
This is most true when glue() is used within a package and even more if the pattern is provided by the package user.
A specific message, such as "Could not find variable 'w' when glueing '{pattern}'", would make it much clearer.
One of the challenges of error handling in R is that most functions generate one of the built-in conditions, which contain only a message and a call. That means that if you want to detect a specific type of error, you can only work with the text of the error message. This is error-prone, not only because the message might change over time, but also because messages can be translated into other languages.
Indeed, dealing with user-defined patterns in glue throwing this error would be a million times easier if this error had a specific error subclass that you would be able to check, as rlang::abort(.subclass=) would do.
Would this be an acceptable feature request?
The text was updated successfully, but these errors were encountered:
When using an unknown variable in
glue()
, the error message can be a little cryptic:Created on 2021-10-24 by the reprex package (v2.0.1)
This is most true when
glue()
is used within a package and even more if the pattern is provided by the package user.A specific message, such as "Could not find variable 'w' when glueing '{pattern}'", would make it much clearer.
Moreover, as read in the book "Advanced R":
Indeed, dealing with user-defined patterns in glue throwing this error would be a million times easier if this error had a specific error subclass that you would be able to check, as
rlang::abort(.subclass=)
would do.Would this be an acceptable feature request?
The text was updated successfully, but these errors were encountered: