Skip to content

Commit 8febdee

Browse files
committed
Rename to match WIFI_REASON. Also include specific error code in "Unknown failure" Exception.
1 parent d1249fb commit 8febdee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared-bindings/wifi/Radio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,12 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m
218218
}
219219

220220
wifi_radio_error_t error = common_hal_wifi_radio_connect(self, ssid.buf, ssid.len, password.buf, password.len, args[ARG_channel].u_int, timeout, bssid.buf, bssid.len);
221-
if (error == WIFI_RADIO_ERROR_AUTH) {
221+
if (error == WIFI_RADIO_ERROR_AUTH_FAIL) {
222222
mp_raise_ConnectionError(translate("Authentication failure"));
223223
} else if (error == WIFI_RADIO_ERROR_NO_AP_FOUND) {
224224
mp_raise_ConnectionError(translate("No network with that ssid"));
225225
} else if (error != WIFI_RADIO_ERROR_NONE) {
226-
mp_raise_ConnectionError(translate("Unknown failure"));
226+
mp_raise_msg_varg(&mp_type_ConnectionError, translate("Unknown failure %d"), error);
227227
}
228228

229229
return mp_const_none;

0 commit comments

Comments
 (0)