Tim Joyce wrote:
> 
> Geir,
> 
> > > one question, if i want to change (eg) ASTMethod.java, do i edit it
> > > normally, or do i have to do something in Parser.jjt?
> >
> > Edit it normally.  What's up?
> 
> nothing, just thinking of adding a simple exception handling interface.
> 

Just for sanity, take a look at the EventCartridge stuff in
whiteboard/geir/listener, and see if what you are thinking about falls
in line with that.

Codewise, it would be very simple in ASTMethod, somewhere around line
255 when handling the user-method-thrown exception, to add code like

  try
  {
     return context.getEventCartridge().methodException( <object>,
<method>, <exception> );
  }
  catch (Exception e )
  {
      package and throw...
  }


which would give you the chance to catch generated exceptions in a
user-defined handler, and either return a valid object after you cleaned
up, or punt and rethrow, letting the wrapped error propogate.

This would result in *zero* performance penalty as it happens when we
are exception handling.

I think this is a good idea, and if you don't come up with something
better, we should incorporate this into the EventCartridge, as it seems
to be a model that people like and want anyway.

geir


-- 
Geir Magnusson Jr.                               [EMAIL PROTECTED]
Developing for the web?  See http://jakarta.apache.org/velocity/

Reply via email to