From 6d82eaa7e9597ebaf292e21e00345be0c50287bf Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 20 Sep 2004 00:55:53 +0000 Subject: r2424: Refactor handling of non-OK NTSTATUS returns to be more swiggish. (This used to be commit aaef6eaf6e0c38fb277d1be0617dfdff559a0115) --- source4/scripting/swig/dcerpc.i | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/scripting/swig/dcerpc.i') diff --git a/source4/scripting/swig/dcerpc.i b/source4/scripting/swig/dcerpc.i index bded875b10..9677d4e62d 100644 --- a/source4/scripting/swig/dcerpc.i +++ b/source4/scripting/swig/dcerpc.i @@ -285,6 +285,16 @@ NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **OUT, const char *username, const char *password); +/* Run this test after each wrapped function */ + +%exception { + $action + if (!NT_STATUS_IS_OK(result)) { + set_ntstatus_exception(NT_STATUS_V(result)); + return NULL; + } +} + %include "librpc/gen_ndr/misc.i" %include "librpc/gen_ndr/lsa.i" %include "librpc/gen_ndr/samr.i" -- cgit