From d21078688dd7f14117d47976a4c1c4d6ac5de67f Mon Sep 17 00:00:00 2001 From: Federico Simoncelli Date: Jul 08 2011 16:08:39 +0000 Subject: python: improve error reporting Signed-off-by: Federico Simoncelli --- diff --git a/python/sanlockmod.c b/python/sanlockmod.c index 4bd3495..1e1c4c4 100644 --- a/python/sanlockmod.c +++ b/python/sanlockmod.c @@ -22,9 +22,11 @@ static PyObject *sanlockmod_exception; static void __set_exception(int en, char *msg) { + char *err_name; PyObject *exc_tuple; - exc_tuple = Py_BuildValue("(is)", en, msg); + err_name = strerror(en); + exc_tuple = Py_BuildValue("(iss)", en, msg, err_name); if (exc_tuple == NULL) { PyErr_NoMemory();