Javascript, Octave, R - Improve exceptions for %catches
and exception specifications for native types. Now the raised exception contains the string value as the exception message instead of just the C/C++ type of the exception. R exceptions were completely swallowed beforehand
This commit is contained in:
parent
b9fa8c23bb
commit
00190c484f
8 changed files with 35 additions and 17 deletions
10
Lib/r/r.swg
10
Lib/r/r.swg
|
|
@ -26,9 +26,13 @@ SWIGEXPORT void SWIG_init(void) {
|
|||
assign(name, _obj);
|
||||
%end_block %enddef
|
||||
|
||||
%define %raise(obj,type,desc)
|
||||
return R_NilValue;
|
||||
%enddef
|
||||
%runtime %{
|
||||
void SWIG_R_Raise(SEXP obj, const char *msg) {
|
||||
Rf_error(Rf_isString(obj) ? STRING_VALUE(obj) : msg);
|
||||
}
|
||||
%}
|
||||
|
||||
#define %raise(OBJ, TYPE, DESC) SWIG_R_Raise(OBJ, "C/C++ exception of type " TYPE); return R_NilValue
|
||||
|
||||
%insert("sinit") "srun.swg"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue