VMware

This Question is Answered

2 "helpful" answers available (6 pts)
3 Replies Last post: Oct 16, 2009 6:17 AM by BlueDevilDan  

Plugins and Java Methods that throw exceptions posted: Oct 14, 2009 10:03 AM

Click to view BlueDevilDan's profile Novice 18 posts since
Jun 17, 2009

I am trying to determine how to deal in my plugin with exposing a java object method that could throw and exception. For the example below, I have added an object mapping for the exception class and the getErrno and getReason methods

in my java script I have

try {

method.invoke();

}

catch (e) {

errno = e.getErrno() ;

}

is the e that I catch going to be my java exception object or is it something else?

When I execute this (with invoke set to throw the exception) I get "TypeError: Cannot find function getErrno"

Click to view Cédric's profile Hot Shot 75 posts since
Jun 27, 2008
Basically, all exceptions are string message, not exceptions objects. What you can do is serialize the error and the message as the Exception string is the message of the excpeptions object.

Developer Social Media

Communities