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:
William S Fulton 2022-09-17 16:06:44 +01:00
commit 00190c484f
8 changed files with 35 additions and 17 deletions

View file

@ -10,7 +10,7 @@ try{
if(error == -1) {
console.log("t.unknown() didn't throw");
} else {
console.log("successfully caught throw in Test::unknown().");
console.log("successfully caught throw in Test::unknown() :" + error);
}
}
@ -22,7 +22,7 @@ catch(error){
if(error == -1) {
console.log("t.simple() did not throw");
} else {
console.log("successfully caught throw in Test::simple().");
console.log("successfully caught throw in Test::simple() :" + error);
}
}
@ -33,7 +33,7 @@ try{
if(error == -1) {
console.log("t.message() did not throw");
} else {
console.log("successfully caught throw in Test::message().");
console.log("successfully caught throw in Test::message() :" + error);
}
}
@ -45,7 +45,7 @@ catch(error){
if(error == -1) {
console.log("t.hosed() did not throw");
} else {
console.log("successfully caught throw in Test::hosed().");
console.log("successfully caught throw in Test::hosed() :" + error + " " + error.code + " " + error.msg);
}
}
@ -58,7 +58,7 @@ for (var i=1; i<4; i++) {
if(error == -1) {
console.log("t.multi(" + i + ") did not throw");
} else {
console.log("successfully caught throw in Test::multi().");
console.log("successfully caught throw in Test::multi() :" + error);
}
}
}
}