January 25, 2013 Re: LinkTerminated without linked thread? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Stephan | 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
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply