Added Ruby support for SWIG_NullReferenceError.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8324 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1ee069a150
commit
384de7d10b
1 changed files with 8 additions and 3 deletions
|
|
@ -6,6 +6,10 @@
|
|||
|
||||
%insert("header") %{
|
||||
|
||||
/* Define custom error for SWIG_NullReferenceError since Ruby does not have a
|
||||
built-in error that seems appropriate. */
|
||||
static VALUE rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
|
||||
|
||||
SWIGINTERN VALUE
|
||||
SWIG_Ruby_ErrorType(int SWIG_code) {
|
||||
VALUE type;
|
||||
|
|
@ -43,6 +47,9 @@ SWIG_Ruby_ErrorType(int SWIG_code) {
|
|||
case SWIG_AttributeError:
|
||||
type = rb_eRuntimeError;
|
||||
break;
|
||||
case SWIG_NullReferenceError:
|
||||
type = rb_eNullReferenceError;
|
||||
break;
|
||||
case SWIG_UnknownError:
|
||||
type = rb_eRuntimeError;
|
||||
break;
|
||||
|
|
@ -52,6 +59,4 @@ SWIG_Ruby_ErrorType(int SWIG_code) {
|
|||
return type;
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue