mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
Add convenience macro for raising exceptions for NTSTATUS / WERROR.
This commit is contained in:
parent
d14c860465
commit
49d522fe38
@ -30,4 +30,16 @@
|
||||
#define PyErr_SetNTSTATUS(status) \
|
||||
PyErr_SetObject(PyExc_RuntimeError, PyErr_FromNTSTATUS(status))
|
||||
|
||||
#define PyErr_NTSTATUS_IS_ERR_RAISE(status) \
|
||||
if (NT_STATUS_IS_ERR(status)) { \
|
||||
PyErr_SetNTSTATUS(status); \
|
||||
return NULL; \
|
||||
}
|
||||
|
||||
#define PyErr_WERROR_IS_ERR_RAISE(status) \
|
||||
if (!W_ERROR_IS_OK(status)) { \
|
||||
PyErr_SetWERROR(status); \
|
||||
return NULL; \
|
||||
}
|
||||
|
||||
#endif /* __PYERRORS_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user