The Apache Software Foundation is proud to present... Version: 2.1.12

Error Handling Samples

Orthogonal views: Content   Pretty content   Links

Back

Back - Back to the samples home page.

Cocoon Exceptions

Demonstrates common Cocoon exceptions and default error handling.

SAXParseException - Attempt to read invalid XML file.
ResourceNotFoundException - Attempt to read non existent file.
ProcessingException - General processing error.
SAXException - SAX processing error.
Wrapped ProcessingException - General processing error wrapped in SAX exception.

Java Exceptions

Demonstrates common Java exceptions and default error handling.

NullPointerException - Generate NullPointerException.
IOException - Generate IOException.

Since Cocoon does not process java.lang.Error (and derived objects), behavior of this sample will depend on behavior of servlet engine. In case of Jetty and Tomcat, they will show empty page and print Error's stacktrace to the console.

Error - Generate Error.

Custom Exception Handling

Demonstrates custom error handling of Cocoon and Application exceptions.

ResourceNotFoundException - Generate ResourceNotFoundException.
ValidationException - Generate ValidationException.
ApplicationException (1) - Generate ApplicationException with error code 1.
ApplicationException (2) - Generate ApplicationException with error code 2.
ApplicationException (3) - Generate ApplicationException with error code 3.
Internal Requests - Internal requests error handling is the new feature introduced in Cocoon 2.1.7 provides a way to handle exceptions for aggregated, included, or used elsewhere, internal pipelines.