Skip to content

Commit ee80c62

Browse files
randy3kCopilot
andauthored
Log error when session finished unexpectedly
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 22b7e2a commit ee80c62

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

R/task.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,15 @@ Task <- R6::R6Class("Task",
4949
return(TRUE)
5050
}
5151
}
52-
return(private$session$get_state() == "finished")
52+
state <- private$session$get_state()
53+
if (identical(state, "finished")) {
54+
if (!is.null(private$error)) {
55+
err <- simpleError("Session finished unexpectedly while task was running")
56+
private$error(err)
57+
}
58+
return(TRUE)
59+
}
60+
return(FALSE)
5361
}
5462

5563
if (is.null(private$process)) {

0 commit comments

Comments
 (0)