eclipsesource / eclipsesource/J2V8
Exception thrown is not reported/captured
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 387
- PR merge metrics
- No merged PRs in 30d
Description
When a method from Java throws an exception called from the javascript object, I can not seem to capture the exception (the exception is not printing any stack trace either). The only way I can capture the exception is to put a try/catch in the method that will throw the exception.
```
public void register() {
V8Object object = new V8Object(engine);
for (Method method : getClass().getMethods()) {
if (method.getAnnotation(Bind.class) != null) {
// Would be nice if I can attach some type of ExceptionHandler
object.registerJavaMethod(this, method.getName(), method.getName(), method.getParameterTypes());
}
}
engine.add("JAVA", object);
}
@Bind public void method() { // if I put try/catch here I can capture the exception
if (true) throw new RunetimeException();
}
```
Contributor guide
Assessment
This issue has not been assessed yet.