tests/exceptions.R

source("incl/start.R")


message("Exceptions ...")

message("- with_progress()")

invalid <- progression(type = "unknown", session_uuid = "dummy", progressor_uuid = "dummy", progression_index = 0L)
print(invalid)
res <- tryCatch(with_progress({
  signalCondition(invalid)
}, handlers = handler_debug), error = identity)
str(res)
stopifnot(inherits(res, "error"))


message("- progress_aggregator()")

invalid <- progression(type = "unknown", session_uuid = "dummy", progressor_uuid = "dummy", progression_index = 0L)
print(invalid)
local({
  progress <- progress_aggregator(progressor(2L))
  res <- tryCatch(progress({
    signalCondition(invalid)
  }), error = identity)
  str(res)
  stopifnot(inherits(res, "error"))
})


message("Exceptions ... done")

source("incl/end.R")

Try the progressr package in your browser

Any scripts or data that you put into this service are public.

progressr documentation built on Aug. 11, 2023, 1:07 a.m.