Subj : Re: Error handling To : netscape.public.mozilla.jseng From : Braden McDaniel Date : Tue Aug 05 2003 10:58 am On Mon, 04 Aug 2003 21:01:27 -0700, Brendan Eich wrote: > Braden McDaniel wrote: > >> Sorry... I got distracted by other things. I'm now getting back to this. >> >> I've gone through the SpiderMonkey code to see how it uses exceptions. >> I don't see how errors defined in *my* js.msg file get mapped to >> exceptions. The logic that maps error definitions to exception types in >> jsexn.c (js_ErrorToException) seems tied to the SpiderMonkey js.msg. What >> am I missing? > > > Nothing. js_ErrorToException is not an API, it's a function internal to > the engine. I realize that. But (for JS_HAS_ERROR_EXCEPTIONS) doesn't it get called regardless of whether the error messages are being pulled from my js.msg or SpiderMonkey's? It looks to me like: * The mapping from entries in my js.msg to JSExnTypes is completely haphazard; the mapping is designed to correspond to the entries in SpiderMonkey's js.msg, which my js.msg very likely will not match. * If one of my exceptions happens to have the same number as JSErr_Limit, a Bad Thing will happen. > Sorry, I didn't see what you want: you want a way to report errors of > your own number and (localizable) message string, and have them turn > into exceptions. It seems that the errors-as-exceptions design in the > engine doesn't support that. Can you file a bug? Thanks, Yes, that is what I want. But if I'm following things correctly, the problem is a bit more than a missing feature. I'll be happy to file a bug, but I want to make sure I'm not misunderstanding the code. -- Braden McDaniel e-mail: Jabber: .