mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-04-19 14:09:43 -04:00
Rework [stage]
This commit is contained in:
@@ -4,6 +4,7 @@ import io.xpipe.app.issue.ErrorAction;
|
||||
import io.xpipe.app.issue.ErrorEvent;
|
||||
import io.xpipe.app.issue.ErrorEventFactory;
|
||||
import io.xpipe.app.process.*;
|
||||
import io.xpipe.app.util.DocumentationLink;
|
||||
import io.xpipe.core.FilePath;
|
||||
import io.xpipe.core.OsType;
|
||||
|
||||
@@ -118,6 +119,10 @@ public class SshIdentityStateManager {
|
||||
var ex = new IllegalStateException("Unable to list agent identities via command ssh-add -l:\n" + joined
|
||||
+ "\n\n" + "Please check whether the agent is running correctly%s.".formatted(posixMessage));
|
||||
var eventBuilder = ErrorEventFactory.fromThrowable(ex).expected();
|
||||
if (joined.toLowerCase().contains("signing failed: agent refused operation") ||
|
||||
joined.toLowerCase().contains("error connecting to agent: connecting refused")) {
|
||||
eventBuilder.documentationLink(DocumentationLink.SSH_AGENT_REFUSAL);
|
||||
}
|
||||
ErrorEventFactory.preconfigure(eventBuilder);
|
||||
throw ex;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ public enum DocumentationLink {
|
||||
SSH_CONNECTION_CLOSED("troubleshoot/ssh#connection-closed-by-remote-host"),
|
||||
SSH_KEY_PERMISSIONS("troubleshoot/ssh#key-permissions-too-open"),
|
||||
SSH_NO_ROUTE("troubleshoot/ssh#no-route-to-host"),
|
||||
SSH_AGENT_REFUSAL("troubleshoot/ssh#agent-refused-operation"),
|
||||
SSH_CONNECTION_TIMEOUT("troubleshoot/ssh#connection-timeout"),
|
||||
SSH_SHELL_TIMEOUT("troubleshoot/ssh#shell-timeout"),
|
||||
SSH_CONFIG("guide/ssh#config-files"),
|
||||
|
||||
Reference in New Issue
Block a user