Hi.

Is there a way currently to get Rhino not to wrap Java exceptions of
particular classes in WrappedException objects?   In Batik I'd like to
ensure that any DOMExceptions that get propagated to script appear as
normal reflected JS objects so that getting the "code" property on it
works (instead of having to do javaException.code).

If there isn't currently a way to do this, I was thinking of extending
WrapFactory with something like:

  public boolean shouldWrapException(Throwable t) {
      // or maybe Exception instead of Throwable?
      return true;
  }

so that I can subclass it to do { return t instanceof
DOMException; }.  ScriptRuntime.newCatchScope() would call
shouldWrapException().

I'll provide a patch if the above is acceptable.

Thanks,

Cameron
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to