From ea848bc9ec3b1296a84b23dfecb39d89bea624b0 Mon Sep 17 00:00:00 2001 From: simonpcouch Date: Mon, 8 Jul 2024 10:39:47 -0500 Subject: [PATCH] more informative output for non-error failure --- R/syrup.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/syrup.R b/R/syrup.R index e2c7392..cc9708a 100644 --- a/R/syrup.R +++ b/R/syrup.R @@ -132,7 +132,13 @@ syrup <- function(expr, interval = .5, peak = FALSE, env = caller_env()) { res <- sesh_res$result if (is.null(res)) { - stop(gsub("\n", " ", conditionMessage(sesh_res$error))) + if (!is.null(sesh_res$error)) { + stop(gsub("\n", " ", conditionMessage(sesh_res$error))) + } else { + stop(paste0("Code: ", sesh_res$code, + " Message: ", sesh_res$message, + " stderr: ", sesh_res$stderr)) + } } if (identical(res$id[length(res$id)], 1) && !isTRUE(peak)) {