mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-01 22:34:07 +01:00
auto-t: handle exceptions correctly for start_ap
The start_ap method was raising potential dbus errors before converting them to an IWD error type. This is due to dbus.Set() not taking an error handler. The only way to address this is to catch the error, convert it and raise the converted error.
This commit is contained in:
parent
d6eade2252
commit
f30c4bf578
@ -425,7 +425,11 @@ class Device(IWDDBusAbstract):
|
||||
self._wait_for_async_op()
|
||||
|
||||
def start_ap(self, ssid, psk):
|
||||
self._prop_proxy.Set(IWD_DEVICE_INTERFACE, 'Mode', 'ap')
|
||||
try:
|
||||
self._prop_proxy.Set(IWD_DEVICE_INTERFACE, 'Mode', 'ap')
|
||||
except Exception as e:
|
||||
raise _convert_dbus_ex(e)
|
||||
|
||||
self._ap_iface = dbus.Interface(self._bus.get_object(IWD_SERVICE,
|
||||
self.device_path),
|
||||
IWD_AP_INTERFACE)
|
||||
|
Loading…
Reference in New Issue
Block a user