]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
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 f36b3393ff177747b77c762337cab04dea2f1b9d..91264dfe4730bf538bfed1d8f8f005ad45bfb1d6 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)
        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;
        }
 
                return -1;
        }