Improve startup shell error handling

This commit is contained in:
crschnick
2026-01-08 13:32:06 +00:00
parent f53d25d055
commit dc0f01a4ff
2 changed files with 13 additions and 8 deletions
@@ -22,6 +22,12 @@ public abstract class AppShellChecker {
}
var originalErr = selfTestErrorCheck();
// If we are already in fallback mode and can somehow continue, we should do so instantly
if (originalErr.isPresent() && originalErr.get().isCanContinue() && !isDefaultShell) {
return;
}
if (originalErr.isPresent()
&& (shouldAttemptFallbackForProcessStartFail()
|| !originalErr.get().isProcessSpawnIssue())) {
@@ -37,12 +43,10 @@ public abstract class AppShellChecker {
var fallbackErr = selfTestErrorCheck();
if (fallbackErr.isPresent()) {
var msg = formatMessage(fallbackErr.get().getMessage());
var event = ErrorEventFactory.fromThrowable(new IllegalStateException(msg));
var event = ErrorEventFactory.fromThrowable(new IllegalStateException(msg))
.documentationLink(DocumentationLink.LOCAL_SHELL_WARNING);
// Only make it terminal if both shells can't continue
if (originalErr.get().isCanContinue()) {
// Toggle back if both shells have issues
toggleFallback();
} else if (!fallbackErr.get().isCanContinue()) {
if (!fallbackErr.get().isCanContinue()) {
event.term();
}
event.handle();
@@ -11,6 +11,7 @@ import io.xpipe.app.process.ProcessOutputException;
import io.xpipe.app.util.Deobfuscator;
import javafx.application.Platform;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.geometry.Insets;
import javafx.scene.control.TextArea;
import javafx.scene.layout.Region;
@@ -57,16 +58,16 @@ public class ErrorHandlerDialog {
false));
}
if (event.isReportable()) {
var reported = new SimpleBooleanProperty();
errorModal.addButton(new ModalButton(
"report",
() -> {
if (UserReportComp.show(event)) {
comp.getTakenAction().setValue(ErrorAction.ignore());
errorModal.close();
reported.set(true);
}
},
false,
false));
false)).augment(button -> button.disableProperty().bind(reported));
errorModal.addButtonBarComp(Comp.hspacer());
}
var hasCustomActions = event.getCustomActions().size() > 0 || event.getLink() != null;