...

/

Exceptions During the Execution of the Worker

Exceptions During the Execution of the Worker

Learn how to handle exceptions during the execution of the worker.

We'll cover the following...

As you have seen in the previous chapter, the facilities of the std.parallelism module automatically catch exceptions that have been thrown during the execution of tasks and rethrow them in the context of the owner. This allows the owner to catch such exceptions:

Press + to interact
try {
theTask.yieldForce();
} catch (Exception exc) {
writefln("Detected an error in the task: '%s'", exc.msg);
}

...