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
Errors thrown within packages (let's say teal.modules.general) will throw a different error from {glue}
How to reproduce
Reproducible code, but not generatable from reprex.
The idea is to have a function inside pkgX that throws an error where the message contains { ... }.
This is the case for checkmate::assert_names
library(teal.logger)
fun<-function(arr, permutation.of= c("a", "b")) {
checkmate::assert_names(names(arr), permutation.of=permutation.of)
}
environment(fun) <- environment(register_handlers)
register_handlers("teal.logger")
fun(list(b=1, c=2))
#> Error in (function (e) : `glue` failed in `formatter_glue` on:#> #> chr "In ‘fun(list(b = 1, c = 2))’: Assertion on 'names(arr)' failed: Names must be a permutation of set {'a','b'}, b"| __truncated__#> #> Raw error message:#> #> Failed to parse glue component#> Caused by error in `parse()`:#> ! <text>:1:4: unexpected ','#> 1: 'a',#> ^#> #> Please consider using another `log_formatter` or `skip_formatter` on strings with curly braces.checkmate::assert_names(names(list(b=1, c=2)), permutation.of= c("a", "b"))
Possible solution
Hint logger to skip formating, this can be done as below or in parse_logger_message function
What happened?
Problem
Errors thrown within packages (let's say
teal.modules.general
) will throw a different error from{glue}
How to reproduce
Reproducible code, but not generatable from reprex.
The idea is to have a function inside
pkgX
that throws an error where the message contains{ ... }
.This is the case for
checkmate::assert_names
Possible solution
Hint logger to skip formating, this can be done as below or in
parse_logger_message
functionsessionInfo()
No response
Relevant log output
No response
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: