Skip to content

Commit 716d1ca

Browse files
committed
Add %exception handling to the queue object
This uses the exception.c functions to handle exceptions. Signed-off-by: Guido Trotter <ultrotter@quaqua.net>
1 parent 1f01e4c commit 716d1ca

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

libnetfilter_queue.i

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include <nfq.h>
55

66
#include <nfq_common.h>
7+
8+
#include <exception.h>
79
%}
810

911
%include exception.i
@@ -24,6 +26,15 @@
2426

2527
%extend queue {
2628

29+
%exception {
30+
char *err;
31+
clear_exception();
32+
$action
33+
if ((err = check_exception())) {
34+
SWIG_exception(SWIG_RuntimeError, err);
35+
}
36+
}
37+
2738
int open();
2839
void close();
2940
int bind(int);

0 commit comments

Comments
 (0)