You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Vadim Gritsenko <vg...@hns.com> on 2001/09/06 17:14:02 UTC

New Source Interface & Exception Handling Issues

Cocooners,

After migrating to new Source interface (extended from
XMLizable), certain exception handling issues arised:

 o Source is unable to throw ProcessingException anymore
(from toSAX method).

Result (in SitemapSource):

 o ProcessingException is wrapped into SAXException

But, getInputSource/getInputStream still can throw
ProcesingException. Result:

 o ProcessingException is wrapped into SAXException, which is
wrapped into ProcessingException (again)

As a result, Sitemap might get either SAXException[ProcessingException],
or even ProcessingException[SAXException[ProcessingException]],
which makes exception handling code ugly and unclear.

Same story applies to FileGenerator and may be to other
components as well.

Proposed solution:
1. Preserve meaningful exceptions up to the exception
handling point (sitemap)
2. Add "throws ProcessingException" to toSAX method of
XMLizable (to satisfy point 1)
3. Think about how to handle exception before writing
"throw new ...Exception("...", exception)"

I would love to hear suggestions from others on this topic.

Regards,
Vadim

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2.1-dev][Patch] JSPReader & sample

Posted by Davanum Srinivas <di...@yahoo.com>.
Done. Please cross-check. I sync'ed the JspEngineImpl.java in C2.0 with the one that you sent for
C2.1.

Thanks,
dims

--- "Piroumian, Konstantin" <KP...@flagship.ru> wrote:
> Hi, Cocooners!
> 
> This is the first working version of JSPReader. I think that it will be
> useful in any project that uses JSP with Cocoon 2. Apply please. An example
> of is provided too.
> 
> As I couldn't get a definite anwser about the 'context://' protocol and its
> resolution, so that protocol is not supported now. To specify a path from
> the root of the application simply use '/path/to/file' format (with leading
> '/'). Does anybody know why '/path/to' is not used instead of 'context://'
> and what is the purpose of 'context://' protocol?
> 
> Regards,
>     Konstantin Piroumian
> 
> 
> 
> 
> 

> ATTACHMENT part 2 application/x-zip-compressed name=JSPReader.zip
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


[C2.1-dev][Patch] JSPReader & sample

Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
Hi, Cocooners!

This is the first working version of JSPReader. I think that it will be
useful in any project that uses JSP with Cocoon 2. Apply please. An example
of is provided too.

As I couldn't get a definite anwser about the 'context://' protocol and its
resolution, so that protocol is not supported now. To specify a path from
the root of the application simply use '/path/to/file' format (with leading
'/'). Does anybody know why '/path/to' is not used instead of 'context://'
and what is the purpose of 'context://' protocol?

Regards,
    Konstantin Piroumian





Re: AW: New Source Interface & Exception Handling Issues

Posted by Davanum Srinivas <di...@yahoo.com>.
Vadim,

+1 from me too. Please go ahead with this.

Thanks,
dims

--- Carsten Ziegeler <cz...@sundn.de> wrote:
> > Vadim Gritsenko wrote:
> > 
> > Cocooners,
> > 
> > After migrating to new Source interface (extended from
> > XMLizable), certain exception handling issues arised:
> > 
> >  o Source is unable to throw ProcessingException anymore
> > (from toSAX method).
> > 
> > Result (in SitemapSource):
> > 
> >  o ProcessingException is wrapped into SAXException
> > 
> > But, getInputSource/getInputStream still can throw
> > ProcesingException. Result:
> > 
> >  o ProcessingException is wrapped into SAXException, which is
> > wrapped into ProcessingException (again)
> > 
> > As a result, Sitemap might get either SAXException[ProcessingException],
> > or even ProcessingException[SAXException[ProcessingException]],
> > which makes exception handling code ugly and unclear.
> > 
> > Same story applies to FileGenerator and may be to other
> > components as well.
> > 
> > Proposed solution:
> > 1. Preserve meaningful exceptions up to the exception
> > handling point (sitemap)
> +1
> 
> > 2. Add "throws ProcessingException" to toSAX method of
> > XMLizable (to satisfy point 1)
> +1, AFAIR the old stream() method did throw the ProcessingException.
> 
> 
> Carsten
> 
> > 3. Think about how to handle exception before writing
> > "throw new ...Exception("...", exception)"
> > 
> > I would love to hear suggestions from others on this topic.
> > 
> > Regards,
> > Vadim
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


AW: New Source Interface & Exception Handling Issues

Posted by Carsten Ziegeler <cz...@sundn.de>.
> Vadim Gritsenko wrote:
> 
> Cocooners,
> 
> After migrating to new Source interface (extended from
> XMLizable), certain exception handling issues arised:
> 
>  o Source is unable to throw ProcessingException anymore
> (from toSAX method).
> 
> Result (in SitemapSource):
> 
>  o ProcessingException is wrapped into SAXException
> 
> But, getInputSource/getInputStream still can throw
> ProcesingException. Result:
> 
>  o ProcessingException is wrapped into SAXException, which is
> wrapped into ProcessingException (again)
> 
> As a result, Sitemap might get either SAXException[ProcessingException],
> or even ProcessingException[SAXException[ProcessingException]],
> which makes exception handling code ugly and unclear.
> 
> Same story applies to FileGenerator and may be to other
> components as well.
> 
> Proposed solution:
> 1. Preserve meaningful exceptions up to the exception
> handling point (sitemap)
+1

> 2. Add "throws ProcessingException" to toSAX method of
> XMLizable (to satisfy point 1)
+1, AFAIR the old stream() method did throw the ProcessingException.


Carsten

> 3. Think about how to handle exception before writing
> "throw new ...Exception("...", exception)"
> 
> I would love to hear suggestions from others on this topic.
> 
> Regards,
> Vadim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org