-
Bug
-
Resolution: Fixed
-
P3
-
fx2.1
Various methods in the JavaScript bridge API ignore JavaScript exceptions. This is probably not a good idea.
We should probably throw a Java exception.
The implementation looks like it would be simple - the tricky part is the desig: how to map the JavaScript exception value to a Java exception.
What seems reasonable to me is to define a new exception class which should extend netscape.javascript.JSException,
since the latter is already used in some of the APIs. The JavaScript exception value would be converted to a Java value (in the usual way) and stored in the JSException. There would be a method to get the value. We also want to make sure that getMessage and toString yield reasonable values, based on the JavaScript exception value.
We should probably throw a Java exception.
The implementation looks like it would be simple - the tricky part is the desig: how to map the JavaScript exception value to a Java exception.
What seems reasonable to me is to define a new exception class which should extend netscape.javascript.JSException,
since the latter is already used in some of the APIs. The JavaScript exception value would be converted to a Java value (in the usual way) and stored in the JSException. There would be a method to get the value. We also want to make sure that getMessage and toString yield reasonable values, based on the JavaScript exception value.