fix(mac): clarify attach-only gateway errors
This commit is contained in:
@@ -174,6 +174,12 @@ final class ControlChannel: ObservableObject {
|
|||||||
case .cancelled:
|
case .cancelled:
|
||||||
return "Gateway connection was closed; start the gateway (localhost:\(port)) and retry."
|
return "Gateway connection was closed; start the gateway (localhost:\(port)) and retry."
|
||||||
case .cannotFindHost, .cannotConnectToHost:
|
case .cannotFindHost, .cannotConnectToHost:
|
||||||
|
if AppStateStore.attachExistingGatewayOnly {
|
||||||
|
return """
|
||||||
|
Cannot reach gateway at localhost:\(port) and “Attach existing gateway only” is enabled.
|
||||||
|
Disable it in Debug Settings or start a gateway on that port.
|
||||||
|
"""
|
||||||
|
}
|
||||||
return "Cannot reach gateway at localhost:\(port); ensure the gateway is running."
|
return "Cannot reach gateway at localhost:\(port); ensure the gateway is running."
|
||||||
case .networkConnectionLost:
|
case .networkConnectionLost:
|
||||||
return "Gateway connection dropped; gateway likely restarted—retry."
|
return "Gateway connection dropped; gateway likely restarted—retry."
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ final class GatewayProcessManager: ObservableObject {
|
|||||||
// Respect debug toggle: only attach, never spawn, when enabled.
|
// Respect debug toggle: only attach, never spawn, when enabled.
|
||||||
if AppStateStore.attachExistingGatewayOnly {
|
if AppStateStore.attachExistingGatewayOnly {
|
||||||
await MainActor.run {
|
await MainActor.run {
|
||||||
self.status = .stopped
|
self.status = .failed("Attach-only enabled; no gateway to attach")
|
||||||
self.appendLog("[gateway] attach-only enabled; not spawning local gateway\n")
|
self.appendLog("[gateway] attach-only enabled; not spawning local gateway\n")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user