MCPcopy Create free account
hub / github.com/PatchMon/PatchMon / deriveCodeFromHttpError

Function deriveCodeFromHttpError

frontend/src/components/RdpViewer.jsx:201–213  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

199 * or a Guacamole Status object (tunnel/client onerror).
200 */
201const 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
215export const classifyGuacUpstreamFailure = (message) => {
216 const lower = (message || "").toLowerCase();

Callers 1

RdpViewerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected