Skip to content

Commit

Permalink
more informative output for non-error failure
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Jul 8, 2024
1 parent 26d7e12 commit ea848bc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/syrup.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit ea848bc

Please sign in to comment.