From: Nir Soffer nsoffer@redhat.com
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@redhat.com --- python/sanlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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);
sanlock-devel@lists.fedorahosted.org