View mode: basic / threaded / horizontal-split · Log in · Help
January 25, 2013
Re: LinkTerminated without linked thread?
On 01/24/2013 02:57 AM, Stephan wrote:

> How can I report an Error or an Exception thrown in a child-thread?
> Should I wrap the whole function that is spawned in a try-catch
> statement to print any exception manually?

You can send the exception as a message as well:

// at the worker:
    try {
        // ...

    } catch (shared(Exception) exc) {
        owner.send(exc);
    }},

// at the owner:
    receive(
        // ...

        (shared(Exception) exc) {
            // ...
        });

Ali
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home