python: Show country code that was invalid
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Jan 2018 16:02:24 +0000 (16:02 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Jan 2018 16:02:24 +0000 (16:02 +0000)
Makes debugging easier

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/network.c

index f36b339..91264df 100644 (file)
@@ -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;
        }