cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: [C2] xsp.xsl/devel code
Date Tue, 17 Oct 2000 15:49:51 GMT
Marcus Crafter wrote:
> Hi All,
>         Hope everything is going well!
>         Recently I've been porting some C1 XSP code over to C2 that uses a
>         several external classes we've written here for our web application.
>         One difference I've noticed is that the generated C2 XSP code does not
>         wrap up developer XSP logic code within a try/catch block like in C1.
>         In C1, the generated 'populateDocument()' method throws type
>         Exception; in effect allowing the developer handle exceptions they
>         want to and/or let others fall through to the error handling
>         capabilities of Cocoon.
>         C2 has no such support (yet?), requiring the developer to handle all
>         possible exceptions their code may throw (the C2 generated 'generate'
>         method can only throw SAXException).
>         My question is, was there a discussion/reason behind this decision ?
>         or was it just the way it happened ? :-)

I guess it's just the way it happened, but I'd welcome some more
reasoning about this.
>         I've attached a patch which adds a global try block to the C2
>         generated 'generate' method, which catches any developer caused
>         exceptions/errors.
>         It repackages them up as ProcessingException's (maybe another name
>         might be better ?) and re-throws them so that Cocoon's inbuilt
>         handling takes care of them. It catches Throwable so that Errors and
>         Exceptions are both handled.
>         Now, I can understand reasons not to do this, but I can also understand
>         reasons to do this, so maybe my patch is not appropriate ? Hence my
>         question above.

Hmmm, it might increase your lazyness which is not good, but on the
other hand it could simplify some coding and adding visibility to the
code which is good.
>         What is everyone else's thoughts ?

I'm +0 on this..., I would love more comments on this before stating a
pending opinion.

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------

View raw message