summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2005-08-25 08:40:07 +0000
committerFrederic Peters <fpeters@entrouvert.com>2005-08-25 08:40:07 +0000
commitf9fea16807166b06e1c551691303679e160b00e0 (patch)
tree830fc77cbbb881ab2513557f10c9a74c60c43daf
parent21fbfdfe0afd0637747e1399cecc4ed1e41f0b6a (diff)
Do not use SWIG_UnknownError but SWIG_RuntimeError so it is translated to a
catchable exception in Java. Use SWIG_ValueError for value errors (things like invalid args)
-rw-r--r--swig/Lasso.i7
1 files changed, 6 insertions, 1 deletions
diff --git a/swig/Lasso.i b/swig/Lasso.i
index 71e4a034..ecd98d9d 100644
--- a/swig/Lasso.i
+++ b/swig/Lasso.i
@@ -292,8 +292,13 @@ static void build_exception_msg(int errorCode, char *errorMsg) {
errorCode = $action
if (errorCode) {
char errorMsg[256];
+ int swig_error = SWIG_RuntimeError;
+ if (errorCode == LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ ||
+ errorCode == LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ) {
+ swig_error = SWIG_ValueError;
+ }
build_exception_msg(errorCode, errorMsg);
- SWIG_exception(SWIG_UnknownError, errorMsg);
+ SWIG_exception(swig_error, errorMsg);
}
}
%enddef