summaryrefslogtreecommitdiff
path: root/extmod/modlwip.c
diff options
context:
space:
mode:
authorJavier Candeira <javier@candeira.com>2017-08-09 14:40:45 +1000
committerJavier Candeira <javier@candeira.com>2017-08-13 22:52:33 +1000
commit35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db (patch)
tree26616de189a9154309287846bf76fb1cdab8ce51 /extmod/modlwip.c
parentb6a328956467339f568b19d9192fbbfdfa47a572 (diff)
all: Raise exceptions via mp_raise_XXX
- Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions.
Diffstat (limited to 'extmod/modlwip.c')
-rw-r--r--extmod/modlwip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/extmod/modlwip.c b/extmod/modlwip.c
index bde251cca..cc10523e5 100644
--- a/extmod/modlwip.c
+++ b/extmod/modlwip.c
@@ -129,15 +129,15 @@ STATIC mp_obj_t lwip_slip_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw,
ip_addr_t iplocal, ipremote;
if (!ipaddr_aton(mp_obj_str_get_str(args[1]), &iplocal)) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "not a valid local IP"));
+ mp_raise_ValueError("not a valid local IP");
}
if (!ipaddr_aton(mp_obj_str_get_str(args[2]), &ipremote)) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "not a valid remote IP"));
+ mp_raise_ValueError("not a valid remote IP");
}
struct netif *n = &lwip_slip_obj.lwip_netif;
if (netif_add(n, &iplocal, IP_ADDR_BROADCAST, &ipremote, NULL, slipif_init, ip_input) == NULL) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "out of memory"));
+ mp_raise_ValueError("out of memory");
}
netif_set_up(n);
netif_set_default(n);
@@ -1033,7 +1033,7 @@ STATIC mp_obj_t lwip_socket_sendall(mp_obj_t self_in, mp_obj_t buf_in) {
break;
}
case MOD_NETWORK_SOCK_DGRAM:
- mp_not_implemented("");
+ mp_raise_NotImplementedError("");
break;
}