From 35f5acdceea38d8302d8418ac5f3af7940ae9ab2 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 30 Jan 2018 16:02:24 +0000 Subject: [PATCH] python: Show country code that was invalid Makes debugging easier Signed-off-by: Michael Tremer --- src/python/network.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.39.2