Open HenrikBengtsson opened 6 years ago
UPDATE: It turns out that the original error object is lost already on the worker side - it is never sent to the master process. From https://github.com/wch/r-source/blob/R-3-4-branch/src/library/parallel/R/worker.R#L33-L40:
## This uses the message rather than the exception since
## the exception class/methods may not be available on the
## master.
handler <- function(e) {
success <<- FALSE
structure(conditionMessage(e),
class = c("snow-try-error","try-error"))
}
That source code comment also explains that this is not a mistake but a deliberate decision. However, it wouldn't hurt to at least to pass it along.
Issue
The original error produced while evaluating an expression on a background PSOCK cluster is not accessible to the master process. Instead, only a regenerated 'simpleError' with the same condtional message is produced and available in the master process.
Example
Troubleshooting
This is because the error that is regenerated with the original message but without preserving the original error object:
However, since the transferred error is of class
try-error
, the original error should be available in attribute "condition", e.g.EDIT 2018-02-21: There was a typo in my code resulting in invalid error objects.