Log WiFi RequestScan failures with D-Bus error detail

The RequestScan result and the underlying sd_bus error were silently
dropped, so a denied or failed scan looked identical to an empty scan
list on the WiFi setup page. Surface both so the deployed-machine
diagnosis (e.g. user not in the networkmanager group) is visible in
~/.local/radiantwave/log.txt.
This commit is contained in:
NeilClack
2026-08-07 19:40:51 -05:00
parent cad834f232
commit 7d9b3f19a2
2 changed files with 13 additions and 2 deletions
+5 -1
View File
@@ -379,7 +379,11 @@ bool NetworkManager::requestScan() {
}
log("Requesting WiFi scan...");
return impl_->device->requestScan();
const bool ok = impl_->device->requestScan();
if (!ok) {
log("RequestScan failed; the network list may stay empty until it succeeds");
}
return ok;
}
std::vector<NetworkInfo> NetworkManager::getScanResults() const {
+7
View File
@@ -1,5 +1,6 @@
#include "nm_device.h"
#include "nm_connection.h"
#include "logger/logger.h"
#include <iostream>
#include <stdexcept>
@@ -188,6 +189,12 @@ bool WifiDevice::requestScan() {
0 // Empty options dict
);
if (r < 0) {
radiantwave::logger::Logger::instance().warning("WiFi",
"RequestScan failed on device " + impl_->object_path + ": " +
(error.message ? error.message : strerror(-r)));
}
sd_bus_error_free(&error);
return r >= 0;
}