Error Generator
http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Main
User Documentation

Generators
Overview

Default
File Generator

Core
HTML Generator
Directory Generator
Image Directory Generator
Fragment Extractor Generator
JSP Generator
Script Generator
Server Pages Generator
Velocity Generator
Request Generator
Status Generator
Stream Generator
Profile Generator
Error Generator
Search Generator

Optional
Php Generator
XML:DB Generator
XML:DB Collection Generator

Error Generator

The error generator creates xml content describing an error condition. This generator is activated by the sitemap manager in case of an error condition.

If a pipeline has defined an error handler, and an error occurs the sitemap manager activates an error generator, feeding the cause of the error into the error generator.

  • Name : !error-notifier!
  • Class: org.apache.cocoon.sitemap.ErrorNotifier
  • Cacheable: no.
  • Mode: sitemap internal
DTD

The error generator generates xml content, having namespace http://apache.org/cocoon/error/2.0, and prefix error.

Usually the error condition is described by an throwable object. The information of this throwable object is used by the error generator producing the xml content. The various elements of the xml content:

  • The element notify is the root element, having. attribute type, and sender. The attribute type has fixed value error. The attribute sender describes the sender of the error notification object, in the current implementation it has fixed value org.apache.cocoon.sitemap.ErrorNotifier.
  • The element title stores some title of this eror notification. In the current implementation it has fixed value Cocoon error.
  • The source element stores the class name of the throwable object of the error notification.
  • The message element stores the getMessage() result of the throwable object of the error notification, and maybe empty.
  • The description element stores the toString() result of the throwable object of the error notification.
  • The optional extra elements stores optional nested exceptions of the throwable object of the error notification.
<!ELEMENT notify (title, source, message, description, extra*)>
<!ATTLIST notiy 
  type CDATA #REQUIRED
  sender CDATA #REQUIRED
>
<!ELEMENT title #PCDATA>
<!ELEMENT source #PCDATA>
<!ELEMENT message #PCDATA>
<!ELEMENT description #PCDATA>
<!ELEMENT extra #PCDATA>
<!ATTLIST extra description #CDATA>
<!ELEMENT statusinfo (group|value)*>
Example

The following example outputs the xml content of an error generator:

<?xml version="1.0"
 xmlns:error="http://apache.org/cocoon/error/2.0
 encoding="UTF-8"?>
 
<error:notify
 error:type="error" 
 error:sender="org.apache.cocoon.sitemap.ErrorNotifier">
 
 <error:title>Cocoon error</error:title>
 <error:source>java.lang.NullPointerException</error:source>
 <error:message></error:message>
 <error:description></error:description>
 <error:extra description=""></error:extra>
</error:notify>
Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.