File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 11Package: rlang
2- Version: 0.4.0.9001
2+ Version: 0.4.0.9002
33Title: Functions for Base Types and Core R and 'Tidyverse' Features
44Description: A toolbox for working with base types, core R features
55 like the condition system, and core 'Tidyverse' features like tidy
Original file line number Diff line number Diff line change 11
22# rlang (development)
33
4+ * ` cnd_muffle() ` now checks that a restart exists before invoking
5+ it. The restart might not exist if the condition is signalled with a
6+ different function (such as ` stop(warning_cnd) ` ).
7+
48* ` trace_length() ` returns the number of frames in a backtrace.
59
610* Added internal utility ` cnd_entrace() ` to add a backtrace to a
Original file line number Diff line number Diff line change @@ -499,13 +499,17 @@ interrupt <- function() {
499499# ' my_particular_msg = calling(cnd_muffle)
500500# ' )
501501cnd_muffle <- function (cnd ) {
502- switch (cnd_type(cnd ),
503- message = invokeRestart( " muffleMessage" ) ,
504- warning = invokeRestart( " muffleWarning" ) ,
505- interrupt = invokeRestart( " resume" ) ,
506- invokeRestart( " rlang_muffle" )
502+ restart <- switch (cnd_type(cnd ),
503+ message = " muffleMessage" ,
504+ warning = " muffleWarning" ,
505+ interrupt = " resume" ,
506+ " rlang_muffle"
507507 )
508508
509+ if (! is_null(findRestart(restart ))) {
510+ invokeRestart(restart )
511+ }
512+
509513 abort(" Can't find a muffling restart" )
510514}
511515
You can’t perform that action at this time.
0 commit comments