mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-07-02 21:11:03 +12:00
Check whether platform has already exited in terminal error handler
This commit is contained in:
parent
b05d24dd14
commit
4c08385098
|
@ -43,13 +43,19 @@ public class TerminalErrorHandler implements ErrorHandler {
|
|||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
} catch (Throwable r) {
|
||||
if (!"Toolkit already initialized".equals(r.getMessage())) {
|
||||
// Check if platform initialization has failed
|
||||
// Check if we already exited
|
||||
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();
|
||||
handleSecondaryException(event, r);
|
||||
return;
|
||||
} else {
|
||||
PlatformState.setCurrent(PlatformState.RUNNING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue