A channel receive returns a remote error stream as a value, not a
raised condition: an error in the peer is data until user code decides
otherwise. The value is a mizu_error_remote condition (see
mizu_error) — an ordinary condition object, so it prints, and
conditionMessage() leads with remote_type: message.
Arguments
- x
for
mizu_is_remote_error(), any R object; formizu_raise(), amizu_error_remotecondition as returned bymizu_recv()ormizu_recv_batch().
Details
mizu_is_remote_error() tests the class. mizu_raise() signals the
condition with stop(), so handlers dispatch on its classes
(mizu_error_remote, then mizu_error, error, condition).
Examples
ch <- mizu_channel(quote(stop("boom")))
x <- mizu_recv(ch, timeout = 5)
mizu_is_remote_error(x)
#> [1] TRUE
conditionMessage(x)
#> [1] "simpleError: boom"