Try-catch
Brett Zamir <[email protected]> Mon, 17 Dec 2007 10:14:18 +0800
| Newsgroups | gmane.comp.mozilla.devel.java |
|---|---|
| Message-ID | <4765DB7A.4020604__46824.5595497594$1197857717$gmane$org@yahoo.com> |
Hello, Does anyone else experience problems with try-catch blocks in LiveConnect? According to the following site, try-catch should catch exceptions from Java: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:LiveConnect_Overview:JavaScript_to_Java_Communication#Handling_Java_Exceptions_in_JavaScript But, in my case, in order to avoid my Firefox extension failing at the first sign of an Exception (e.g., due to user-submitted data), I've needed to catch the errors first by writing wrapper classes around the methods that return Exceptions. That's ok for very small cases, but one would have to write a whole lot of wrapper classes if one were to try to wrap all of a large existing library (such as I'm incidentally hoping to do with Saxonica to provide XQuery, XSLT 2.0, etc. support for Firefox extensions, if anyone can help answer my recent question on differences in Java or LiveConnect on the Mac!). Anyhow, *if you do experience try-catch problems*, and this is important to you (I can't imagine why it wouldn't if you're using LiveConnect), then *please consider* a reply to that effect and *voting on the bug *I set up earlier at.https://bugzilla.mozilla.org/show_bug.cgi?id=391642 I really hope someone can answer here, as it seems like no one replies to messages in here! best wishes, Brett