Subj : exceptions To : netscape.public.mozilla.jseng From : "Jeroen de Borst" Date : Fri Mar 05 2004 10:33 am Hi, I would like my C code to throw an exception that I can then catch from the script that invoked it. Ideally the exception I throw would be subclassed from "Error" (so I'll inherit the toString() method and stack property; the message property would be overloaded). So I'd need to create a prototype object with the Error class defined in jsexn.c (ExceptionClass), and then I can use that in a call to JS_InitClass. But ExceptionClass is a static structure. So I don't see how to do this without modifying the SpiderMonkey source (which I don't want to do for licensing reasons). Is there another (intended) way to do this? thanks, Jeroen .