Skip to content

rlang 0.4.1

Choose a tag to compare

@lionel- lionel- released this 24 Oct 15:03
  • New experimental framework for creating bulleted error messages. See
    ?cnd_message for the motivation and an overwiew of the tools we
    have created to support this approach. In particular, abort() now
    takes character vectors to assemble a bullet list. Elements named
    x are prefixed with a red cross, elements named i are prefixed
    with a blue info symbol, and unnamed elements are prefixed with a
    bullet.

  • Capture of backtrace in the context of rethrowing an error from an
    exiting handler has been improved. The tryCatch() context no
    longer leaks in the high-level backtrace.

  • Printing an error no longer recommends calling last_trace(),
    unless called from last_error().

  • env_clone() no longer recreates active bindings and is now just an
    alias for env2list(as.list(env)). Unlike as.list() which returns
    the active binding function on R < 4.0, the value of active bindings
    is consistently used in all versions.

  • The display of rlang errors derived from parent errors has been
    improved. The simplified backtrace (as printed by
    rlang::last_error()) no longer includes the parent errors. On the
    other hand, the full backtrace (as printed by rlang::last_trace())
    now includes the backtraces of the parent errors.

  • cnd_signal() has improved support for rlang errors created with
    error_cnd(). It now records a backtrace if there isn't one
    already, and saves the error so it can be inspected with
    rlang::last_error().

  • rlang errors are no longer formatted and saved through
    conditionMessage(). This makes it easier to use a
    conditionMessage() method in subclasses created with abort(),
    which is useful to delay expensive generation of error messages
    until display time.

  • abort() can now be called without error message. This is useful
    when conditionMessage() is used to generate the message at
    print-time.

  • Fixed an infinite loop in eval_tidy(). It occurred when evaluating
    a quosure that inherits from the mask itself.

  • env_bind()'s performance has been significantly improved by fixing a bug
    that caused values to be repeatedly looked up by name.

  • cnd_muffle() now checks that a restart exists before invoking
    it. The restart might not exist if the condition is signalled with a
    different function (such as stop(warning_cnd)).

  • trace_length() returns the number of frames in a backtrace.

  • Added internal utility cnd_entrace() to add a backtrace to a
    condition.

  • rlang::last_error() backtraces are no longer displayed in red.

  • x %|% y now also works when y is of same length as x (@rcannood, #806).

  • Empty named lists are now deparsed more explicitly as
    "<named list>".

  • Fixed chr() bug causing it to return invisibly.