From: Michael Tremer Date: Tue, 30 Jan 2018 16:02:24 +0000 (+0000) Subject: python: Show country code that was invalid X-Git-Tag: 0.9.0~89 X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Flibloc.git;a=commitdiff_plain;h=35f5acdceea38d8302d8418ac5f3af7940ae9ab2 python: Show country code that was invalid Makes debugging easier Signed-off-by: Michael Tremer --- diff --git a/src/python/network.c b/src/python/network.c index f36b339..91264df 100644 --- a/src/python/network.c +++ b/src/python/network.c @@ -83,7 +83,8 @@ static int Network_set_country_code(NetworkObject* self, PyObject* value) { int r = loc_network_set_country_code(self->network, country_code); if (r) { if (r == -EINVAL) - PyErr_SetString(PyExc_ValueError, "Invalid country code"); + PyErr_Format(PyExc_ValueError, + "Invalid country code: %s", country_code); return -1; }