{"record":{"id":"b27924f624eac12e","repo":"eythaann/Seelen-UI","slug":"connection-failed","errorCode":null,"errorMessage":"Connection failed","messagePattern":"Connection failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/ui/svelte/network-popup/components/WlanEntry.svelte","lineNumber":86,"sourceCode":"\n      // Known networks: try with saved credentials first; on failure ask for password\n      if (!showFields && entry.known && entry.ssid) {\n        const success = await invoke(SeelenCommand.WlanConnect, {\n          ssid: entry.ssid,\n          password: null,\n          hidden: false,\n        });\n        forceShowFields = !success;\n        return;\n      }\n\n      // Unknown / secured networks: user must provide credentials\n      const success = await invoke(SeelenCommand.WlanConnect, {\n        ssid,\n        password: password || null,\n        hidden: !entry.ssid,\n      });\n      if (!success) throw new Error(\"Connection failed\");\n    });\n  }\n\n  function handleKeydown(e: KeyboardEvent) {\n    if (e.key === \"Enter\") onConnection();\n  }\n\n  async function onForget() {\n    if (!entry.ssid) return;\n    const ssid = entry.ssid;\n    transition.start(async () => {\n      await invoke(SeelenCommand.WlanForget, { ssid });\n    });\n  }\n\n  const signalIcon = $derived.by((): IconName => {\n    if (entry.signal > 75) return \"GrWifi\";\n    if (entry.signal > 50) return \"GrWifiMedium\";","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/eythaann/Seelen-UI/blob/dee4aaa94066c5d0888ab25554864862fc47be15/src/ui/svelte/network-popup/components/WlanEntry.svelte#L68-L104","documentation":"In the network popup's `WlanEntry`, `onConnection` invokes `SeelenCommand.WlanConnect` with the SSID/password and throws `Connection failed` when the backend returns a falsy success value. This means the backend Wi-Fi connect attempt (wrong password, unavailable network, OS rejection) did not succeed.","triggerScenarios":"User submits a wrong password for a secured network; hidden network connect fails; the profile/network is out of range or the WLAN service rejects the request, so `invoke(SeelenCommand.WlanConnect, ...)` returns false.","commonSituations":"Typo in the Wi-Fi password; selecting a hidden SSID that isn't actually broadcasting; corporate networks requiring extra provisioning (802.1X) that a simple SSID+password connect cannot satisfy.","solutions":["Re-enter the correct password and retry.","Check the network is in range / the router is broadcasting (for hidden networks verify the SSID and `hidden` flag).","Inspect backend logs for the underlying Windows WLAN error code to distinguish auth failure vs. availability; add user-facing feedback instead of a bare throw."],"exampleFix":"// before\nif (!success) throw new Error(\"Connection failed\");\n// after\nif (!success) {\n  showError(i18n(\"network.connection_failed\")); // show message in the popup\n  return;\n}","handlingStrategy":"try-catch","validationCode":"// validate before invoking\nif (!ssid && !entry.ssid) return; // nothing to connect to\nif (entry.secured && !password) { promptForPassword(); return; }","typeGuard":"function canAttemptConnect(ssid: string | null, password: string | null, secured: boolean): boolean {\n  return Boolean(ssid || !ssid === false) && (!secured || !!password);\n}","tryCatchPattern":"try {\n  const success = await invoke(SeelenCommand.WlanConnect, {\n    ssid, password: password || null, hidden: !entry.ssid,\n  });\n  if (!success) showError(\"Connection failed — check the password and network range\");\n} catch (e) {\n  showError(String(e));\n}","preventionTips":["Show inline error feedback to the user instead of only throwing.","Require a password prompt for secured networks before invoking.","Log the backend WLAN error code to distinguish auth vs availability failures."],"tags":["network","wlan","invoke","user-input"],"backgroundTag":"wlan-connect-failed","analyzedSha":"dee4aaa94066c5d0888ab25554864862fc47be15","analyzedAt":"2026-09-03T10:20:37.842Z","contentChangedAt":"2026-09-03T10:20:37.842Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}