eythaann/Seelen-UI · error · Error

Connection failed

Error message

Connection failed

What it means

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.

Source

Thrown at src/ui/svelte/network-popup/components/WlanEntry.svelte:86

      // Known networks: try with saved credentials first; on failure ask for password
      if (!showFields && entry.known && entry.ssid) {
        const success = await invoke(SeelenCommand.WlanConnect, {
          ssid: entry.ssid,
          password: null,
          hidden: false,
        });
        forceShowFields = !success;
        return;
      }

      // Unknown / secured networks: user must provide credentials
      const success = await invoke(SeelenCommand.WlanConnect, {
        ssid,
        password: password || null,
        hidden: !entry.ssid,
      });
      if (!success) throw new Error("Connection failed");
    });
  }

  function handleKeydown(e: KeyboardEvent) {
    if (e.key === "Enter") onConnection();
  }

  async function onForget() {
    if (!entry.ssid) return;
    const ssid = entry.ssid;
    transition.start(async () => {
      await invoke(SeelenCommand.WlanForget, { ssid });
    });
  }

  const signalIcon = $derived.by((): IconName => {
    if (entry.signal > 75) return "GrWifi";
    if (entry.signal > 50) return "GrWifiMedium";

View on GitHub (pinned to dee4aaa940)

Solutions

  1. Re-enter the correct password and retry.
  2. Check the network is in range / the router is broadcasting (for hidden networks verify the SSID and `hidden` flag).
  3. 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.

Example fix

// before
if (!success) throw new Error("Connection failed");
// after
if (!success) {
  showError(i18n("network.connection_failed")); // show message in the popup
  return;
}
Defensive patterns

Strategy: try-catch

Validate before calling

// validate before invoking
if (!ssid && !entry.ssid) return; // nothing to connect to
if (entry.secured && !password) { promptForPassword(); return; }

Type guard

function canAttemptConnect(ssid: string | null, password: string | null, secured: boolean): boolean {
  return Boolean(ssid || !ssid === false) && (!secured || !!password);
}

Try / catch

try {
  const success = await invoke(SeelenCommand.WlanConnect, {
    ssid, password: password || null, hidden: !entry.ssid,
  });
  if (!success) showError("Connection failed — check the password and network range");
} catch (e) {
  showError(String(e));
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of eythaann/Seelen-UI@dee4aaa940 (2026-09-03). Data as JSON: /api/errors/b27924f624eac12e. Report an issue: GitHub.