rlang 1.0.3
-
Child errors may now have empty messages to enable this pattern:
Error in `my_function()`: Caused by error in `their_function()`: ! Message. -
The
rlib_bytesclass now uses prettyunits to format bytes. The
bytes are now represented with decimal prefixes instead of binary
prefixes. -
Supplying a frame environment to the
callargument ofabort()
now causes the corresponding function call in the backtrace to be
highlighted.In addition, if you store the argument name of a failing input in
theargerror field, the argument is also highlighted in the
backtrace.Instead of:
cli::cli_abort("{.arg {arg}} must be a foobar.", call = call)You can now write this to benefit from arg highlighting:
cli::cli_abort("{.arg {arg}} must be a foobar.", arg = arg, call = call) -
abort(message = )can now be a function. In this case, it is
stored in theheaderfield and acts as acnd_header()method
invoked when the message is displayed. -
New
obj_type_oo()function incompat-obj-type.R(#1426). -
friendly_type_of()fromcompat-obj-type.R(formerly
compat-friendly-type.R) is nowobj_type_friendly(). -
options(backtrace_on_error = "collapse")andprint(trace, simplify = "collapse")are deprecated. They fall back to"none"
with a warning. -
call_match()now better handles...whendots_expand = FALSE. -
list2(!!!x)is now faster whenxis a list. It is now returned
as is instead of being duplicated into a new list. -
abort()gains a.trace_bottomargument to disambiguate from
other.frame. This allowscli::cli_abort()to wrapabort()in
such a way that.internalmentions the correct package to report
the error in (#1386). -
The
transpose()compat is now more consistent with purrr when
inner names are not congruent (#1346). -
New
reset_warning_verbosity()andreset_message_verbosity()
functions. These reset the verbosity of messages signalled with
warn()andinform()with the.frequencyargument. This is
useful for testing verbosity in your package (#1414). -
check_dots_empty()now allows trailing missing arguments (#1390). -
Calls to local functions that are not accessible through
::or
:::are now marked with(local)in backtraces (#1399). -
Error messages now mention indexed calls like
foo$bar(). -
New
env_coalesce()function to copy bindings from one environment
to another. Unlike approaches based on looping with[[<-,
env_coalesce()preserves active and lazy bindings. -
Chaining errors at top-level (directly in the console instead of in
a function) no longer fails (#1405). -
Warning style is propagated across parent errors in chained error
messages (#1387). -
check_installed()now works within catch-alltryCatch(error = )
expressions (#1402, tidyverse/ggplot2#4845). -
arg_match()andarg_match0()now mention the correct call in
case of type error (#1388). -
abort()andinform()now print messages tostdoutin RStudio
panes (#1393). -
is_installed()now detects unsealed namespaces (#1378). This fixes
inconsistent behaviour when run within user onLoad hooks. -
Source references in backtraces and
last_error()/last_trace()instructions
are now clickable in IDEs that support links (#1396). -
compat-cli.Rnow supportsstyle_hyperlink(). -
abort(.homonyms = "error")now throws the expected error (#1394). -
env_binding_are_active()no longer accidentally triggers active bindings
(#1376). -
Fixed bug in
quo_squash()with nested quosures containing the
missing argument.