| 199 | * or a Guacamole Status object (tunnel/client onerror). |
| 200 | */ |
| 201 | const deriveCodeFromHttpError = (err) => { |
| 202 | const data = err?.response?.data; |
| 203 | if (data?.code && GUIDANCE[data.code]) return data.code; |
| 204 | const msg = (data?.error || err?.message || "").toLowerCase(); |
| 205 | if (msg.includes("guacd")) return "guacd_unavailable"; |
| 206 | if ( |
| 207 | msg.includes("agent not connected") || |
| 208 | msg.includes("agent is not connected") |
| 209 | ) |
| 210 | return "agent_disconnected"; |
| 211 | if (msg.includes("rdp-proxy-enabled")) return "agent_rdp_disabled"; |
| 212 | return "rdp_unknown"; |
| 213 | }; |
| 214 | |
| 215 | export const classifyGuacUpstreamFailure = (message) => { |
| 216 | const lower = (message || "").toLowerCase(); |