Skip to content

Commit 9acaafe

Browse files
Use tryInvokeRestart() instead of invokeRestart(), because these conditions might not be signaled via the standard mechanisms and therefore not have restarts
1 parent 4e3e5e2 commit 9acaafe

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future
2-
Version: 1.67.0-9010
2+
Version: 1.67.0-9011
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Depends:
55
R (>= 3.2.0)

R/backend_api-evalFuture.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ attachPackages <- function(packages) {
3636
}
3737
NULL
3838
}, packageStartupMessage = function(m) {
39-
invokeRestart("muffleMessage")
39+
tryInvokeRestart("muffleMessage")
4040
})
4141
}, error = identity)
4242
} ## attachPackages()

R/protected_api-signalConditions.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ muffleCondition <- function(cond, pattern = "^muffle") {
278278
muffled <- FALSE
279279
if (inherits(cond, "message")) {
280280
muffled <- grepl(pattern, "muffleMessage")
281-
if (muffled) invokeRestart("muffleMessage")
281+
if (muffled) tryInvokeRestart("muffleMessage")
282282
} else if (inherits(cond, "warning")) {
283283
muffled <- grepl(pattern, "muffleWarning")
284-
if (muffled) invokeRestart("muffleWarning")
284+
if (muffled) tryInvokeRestart("muffleWarning")
285285
} else if (inherits(cond, "condition")) {
286286
if (!is.null(pattern)) {
287287
## If there is a "muffle" restart for this condition,
@@ -291,7 +291,7 @@ muffleCondition <- function(cond, pattern = "^muffle") {
291291
name <- restart[["name"]]
292292
if (is.null(name)) next
293293
if (!grepl(pattern, name)) next
294-
invokeRestart(restart)
294+
tryInvokeRestart(restart)
295295
muffled <- TRUE
296296
break
297297
}

0 commit comments

Comments
 (0)