On Sunday, 26 March 2017 at 18:50:13 UTC, bauss wrote:
On Sunday, 26 March 2017 at 11:46:39 UTC, Jolly James wrote:
[...]

Chances are it's invoked in another thread and thus you can't catch it like that.

To sum it up.

Ex.

void thisFunctionThrows() { ... }

void ableToCatch() {
    try {
        thisFunctionThrows();
    }
    catch (Exception e) {
        // We can catch the exception ...
    }
}

void notAbleToCatch() {
    try {
        spawn(&thisFunctionThrows);
    }
    catch (Exception e) {
        // We cannot catch the exception ...
    }
}

void ableToCatchToo() {
spawn(&ableToCatch); // We're able to handle the exception, because the try/catch is handled in the thread that calls the function that throws.
}

If you want try to help me, mabye this helps you:
https://github.com/CyberShadow/ae/blob/master/net/asockets.d#L1237

Reply via email to