python/sanlock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit b79bd2ac317427908ced4834cc08a1198ce327a1
Author: Nir Soffer <nsoffer(a)redhat.com>
Date: Wed Jan 4 22:56:10 2017 +0200
python: Use error description in SanlockException
When raising SanlockException, if the error code was a posix error, we
included the error description from strerror(3), but for sanlock error
codes we included a rather unhelpful "Sanlock exception".
Now that we have sanlock_strerror() we can use it to include the actual
error description:
sanlock.SanlockException: (-223, 'Sanlock resource read failure',
'Lease does not exist on storage')
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
diff --git a/python/sanlock.c b/python/sanlock.c
index f2ad672..0ef1174 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -54,7 +54,7 @@ __set_exception(int en, char *msg)
en = -en;
err_name = strerror(en);
} else {
- err_name = "Sanlock exception";
+ err_name = sanlock_strerror(en);
}
exc_tuple = Py_BuildValue("(iss)", en, msg, err_name);