mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-10-02 18:17:27 +13:00
Check whether platform has already exited in terminal error handler
This commit is contained in:
parent
b05d24dd14
commit
4c08385098
1 changed files with 10 additions and 4 deletions
|
@ -43,13 +43,19 @@ public class TerminalErrorHandler implements ErrorHandler {
|
||||||
} catch (InterruptedException ignored) {
|
} catch (InterruptedException ignored) {
|
||||||
}
|
}
|
||||||
} catch (Throwable r) {
|
} catch (Throwable r) {
|
||||||
if (!"Toolkit already initialized".equals(r.getMessage())) {
|
// Check if we already exited
|
||||||
// Check if platform initialization has failed
|
if ("Platform.exit has been called".equals(r.getMessage())) {
|
||||||
|
PlatformState.setCurrent(PlatformState.EXITED);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("Toolkit already initialized".equals(r.getMessage())) {
|
||||||
|
PlatformState.setCurrent(PlatformState.RUNNING);
|
||||||
|
} else {
|
||||||
|
// Platform initialization has failed in this case
|
||||||
event.clearAttachments();
|
event.clearAttachments();
|
||||||
handleSecondaryException(event, r);
|
handleSecondaryException(event, r);
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
PlatformState.setCurrent(PlatformState.RUNNING);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue