From 0eb4d56ae2d214de171f4866b3ac50d992bb5542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Mon, 13 Mar 2023 20:48:36 +0100 Subject: [PATCH] Add argument to handler functions --- beyond-exception-handling.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beyond-exception-handling.Rmd b/beyond-exception-handling.Rmd index 634938553..f41cabec1 100644 --- a/beyond-exception-handling.Rmd +++ b/beyond-exception-handling.Rmd @@ -424,7 +424,7 @@ eponymous restart. Such functions are called *restart functions*. You could define a restart function for `skip_log_entry` like this: ```{r} -skip_log_entry <- function() invokeRestart("skip_log_entry") +skip_log_entry <- function(e) invokeRestart("skip_log_entry") ``` Then you could change the definition of `log_analyzer()` to this: @@ -451,7 +451,7 @@ code that doesn't have a `skip_log_entry` restart established, you could change the `skip_log_entry` function to this: ```{r} -skip_log_entry <- function() { +skip_log_entry <- function(e) { r <- findRestart("skip_log_entry") if (is.null(r)) return()