Skip to content

Commit 56bd97f

Browse files
authored
Add condition classes to a 'miraiError' (#401)
* Add condition classes to a miraiError * Adds conditionCall and conditionMessage methods for miraiError * Do not even need conditionCall and conditionMessage methods
1 parent db82005 commit 56bd97f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

NEWS.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@
1919
* `require_daemons()` arguments are swapped so that `.compute` comes before `call` for ease of use.
2020
Previous usage will work for the time being, although is deprecated and will be defunct in a future version.
2121
* Enhancements to `everywhere()`:
22-
+ Consecutive `everywhere()` calls are now permissible again when using dispatcher (behaviour update in v2.4.1) (#354).
22+
+ Consecutive `everywhere()` calls are permissible again when using dispatcher (behaviour update in v2.4.1) (#354).
2323
+ No longer has any effect on the RNG stream when using a reproducible `seed` value at `daemons()` (#356).
2424
* `mirai_map()` now supports Arrow Tables and Polars DataFrames (#366).
2525
* `daemon()` gains a `tlscert` argument for custom TLS certificates.
2626
The change in argument name lets this be passed when making a `daemons()` call (#344).
2727
* The `tls` argument at `daemon()`, `launch_local()` and `launch_remote()` is deprecated.
2828
* `as.promise()` method for mirai made robust for high-throughput scenarios (#377).
29-
* The print method for a `miraiError` now includes the customary additional line break (thanks @sebffischer, #399).
30-
* A `mirai()` evaluated on an ephemeral daemon now returns invisibly, consistent with other cases (#351).
29+
* `miraiError` enhancements:
30+
+ Preserves the original condition classes and may be re-thrown as the original condition (thanks @sebffischer, #400).
31+
+ The print method includes the customary additional line break (thanks @sebffischer, #399).
32+
* A `mirai()` evaluated on an ephemeral daemon returns invisibly, consistent with other cases (#351).
3133
* Requires nanonext >= [1.6.2.9001].
3234

3335
# mirai 2.4.1

R/mirai.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,8 @@ mk_mirai_error <- function(cnd, sc) {
626626
))))
627627
sc <- sc[(length(sc) - 1L):(idx + 1L)]
628628
if (sc[[1L]][[1L]] == ".handleSimpleError") sc <- sc[-1L]
629-
sc <- lapply(sc, `attributes<-`, NULL)
630-
out <- `attributes<-`(msg, `[[<-`(cnd, "stack.trace", sc))
631-
`class<-`(out, c("miraiError", "errorValue", "try-error"))
629+
cnd[["stack.trace"]] <- lapply(sc, `attributes<-`, NULL)
630+
`class<-`(`attributes<-`(msg, cnd), c("miraiError", "errorValue", "try-error", class(cnd)))
632631
}
633632

634633
.miraiInterrupt <- `class<-`("", c("miraiInterrupt", "errorValue", "try-error"))

0 commit comments

Comments
 (0)