> From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
> 
> Hi !
> 
>       I'd like to handle several kinds of errors, differently if
possible ;
> on my site, the pipeline serves mainly ".html" pages using the XML
files
> which have the same filename but with the ".xml" extension. More
> precisely, if the file xxx.html is requested, I aggregate xxx.xml and
> site.xml, which is a file which contains infos about navbars, page
> titles... for the whole site (I need it to create the navbars, the
> titles...) and then, I use an XSL transformation and I serialize in
> HTML. Anyway, here are the different kinds of error I'd like to handle
:
> 
> - the requested file has not the ".html" extension
>   using something like :
> 
>    <map:handle-errors type="404">
>     <map:transform src="stylesheets/skeletons/error2html.xsl"/>
>     <map:serialize status-code="404"/>
>    </map:handle-errors>
> 
>   should work (by the way, was is the purpose of status-code="404" ?)

It handles not found resources.

> 
> - the xxx.xml file does not exist
>   In this cas, I've got half of my content (I've got site.xml)
>   is there a way to tell cocoon to handle this error ?

Use resource-exists action
(org.apache.cocoon.acting.ResourceExistsAction) to check for xml file
existence.


>   I've found that the error message is displayed only if I use
> map:handle-errors type="404"
>   with map:serialize status-code="404"...
> 
> - the xxx.xml file is invalid
>   In this cas, I've got also half of my content (I've got site.xml)
>   is there a way to tell cocoon to handle this error ?
>   I've found that depending on what I put in map:handle-errors, cocoon
> displays an "internal
>   server error" or uses my error2html.xsl to write something like
"error
> creating resource"

Have second error handler for this
<map:handle-errors> <!-- no type="404" here! -->
  ...
</map:handle-errors>

Vadim



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to