From 781ad038c96195031053291414a12225eb818fd9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 25 Feb 2010 16:16:33 +1100 Subject: s4-krb5: propogate errors from a lot more kerberos functions We need to be able to give sensible error messages when a kerberos calls fails. This propogates the kerberos error up the stack to the caller. Pair-Programmed-With: Andrew Bartlett --- source4/libcli/util/pyerrors.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/libcli/util') diff --git a/source4/libcli/util/pyerrors.h b/source4/libcli/util/pyerrors.h index 66823f4a41..3fd2a7c9fa 100644 --- a/source4/libcli/util/pyerrors.h +++ b/source4/libcli/util/pyerrors.h @@ -24,6 +24,11 @@ #define PyErr_FromNTSTATUS(status) Py_BuildValue("(i,s)", NT_STATUS_V(status), discard_const_p(char, get_friendly_nt_error_msg(status))) +#define PyErr_FromString(str) Py_BuildValue("(s)", discard_const_p(char, str)) + +#define PyErr_SetStringError(str) \ + PyErr_SetObject(PyExc_RuntimeError, PyErr_FromString(str)) + #define PyErr_SetWERROR(err) \ PyErr_SetObject(PyExc_RuntimeError, PyErr_FromWERROR(err)) -- cgit