File tree Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 5
5
%include " std_pair.i"
6
6
%include " std_map.i"
7
7
8
+ %include " exception.i"
9
+
8
10
%{
9
11
#include < AvTranscoder/common.hpp>
10
12
Original file line number Diff line number Diff line change
1
+ %include <std_except.i>
2
+
3
+ /*
4
+ All swig exception types:
5
+ SWIG_MemoryError
6
+ SWIG_IndexError
7
+ SWIG_RuntimeError
8
+ SWIG_IOError
9
+ SWIG_TypeError
10
+ SWIG_OverflowError
11
+ SWIG_ValueError
12
+
13
+ SWIG_DivisionByZero
14
+ SWIG_SyntaxError
15
+ SWIG_SystemError
16
+ */
17
+
18
+ %exception {
19
+ try
20
+ {
21
+ $action
22
+ }
23
+ catch ( std::out_of_range& e )
24
+ {
25
+ SWIG_exception ( SWIG_IndexError, e.what () );
26
+ }
27
+ catch ( std::bad_alloc& e )
28
+ {
29
+ SWIG_exception ( SWIG_MemoryError, e.what () );
30
+ }
31
+ catch ( std::ios_base::failure& e )
32
+ {
33
+ SWIG_exception ( SWIG_IOError, e.what () );
34
+ }/*
35
+ catch( std::bad_cast& e )
36
+ {
37
+ SWIG_exception( SWIG_TypeError, e.what() );
38
+ }*/
39
+ catch ( std::overflow_error& e )
40
+ {
41
+ SWIG_exception ( SWIG_OverflowError, e.what () );
42
+ }
43
+ catch ( std::underflow_error& e )
44
+ {
45
+ SWIG_exception ( SWIG_OverflowError, e.what () );
46
+ }
47
+ catch ( std::invalid_argument& e )
48
+ {
49
+ SWIG_exception ( SWIG_ValueError, e.what () );
50
+ }
51
+ catch ( std::exception& e )
52
+ {
53
+ SWIG_exception ( SWIG_RuntimeError, e.what () );
54
+ }
55
+ catch (...)
56
+ {
57
+ SWIG_exception ( SWIG_RuntimeError, " Unknown C++ exception" );
58
+ }
59
+
60
+ }
You can’t perform that action at this time.
0 commit comments