org.apache.cocoon
Class ProcessingException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.apache.commons.lang.exception.NestableException
              extended byorg.apache.cocoon.util.location.LocatedException
                  extended byorg.apache.cocoon.ProcessingException
All Implemented Interfaces:
Locatable, LocatableException, MultiLocatable, org.apache.commons.lang.exception.Nestable, Serializable
Direct Known Subclasses:
ConnectionResetException, InvalidContinuationException, InvalidServiceException, LoadException, ResourceNotFoundException

public class ProcessingException
extends LocatedException
implements MultiLocatable

This Exception is thrown every time there is a problem in processing a request.

Version:
CVS $Id: ProcessingException.java 280632 2005-09-13 19:35:46Z sylvain $
Author:
Pierpaolo Fumagalli (Apache Software Foundation)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.commons.lang.exception.NestableException
delegate
 
Constructor Summary
  ProcessingException(Exception ex)
          Creates a new ProcessingException instance.
  ProcessingException(String message)
          Construct a new ProcessingException instance.
  ProcessingException(String message, Location location)
          Construct a new ProcessingException that has an associated location.
  ProcessingException(String message, Throwable t)
          Construct a new ProcessingException that references a parent Exception.
protected ProcessingException(String message, Throwable t, Location location)
          Construct a new ProcessingException that has a parent exception and an associated location.
 
Method Summary
static ProcessingException throwLocated(String message, Throwable thr, List locations)
          Throw a located exception given an existing exception and the locations where this exception was catched.
static ProcessingException throwLocated(String message, Throwable thr, Location location)
          Throw a located exception given an existing exception and the location where this exception was catched.
 
Methods inherited from class org.apache.cocoon.util.location.LocatedException
addCauseLocations, addLocation, ensureCauseChainIsSet, getLocation, getLocations, getMessage, getMessage, getRawMessage
 
Methods inherited from class org.apache.commons.lang.exception.NestableException
getCause, getMessage, getMessages, getThrowable, getThrowableCount, getThrowables, indexOfThrowable, indexOfThrowable, printPartialStackTrace, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.util.location.MultiLocatable
addLocation, getLocations
 
Methods inherited from interface org.apache.cocoon.util.location.Locatable
getLocation
 

Constructor Detail

ProcessingException

public ProcessingException(String message)
Construct a new ProcessingException instance.


ProcessingException

public ProcessingException(Exception ex)
Creates a new ProcessingException instance.

Parameters:
ex - an Exception value

ProcessingException

public ProcessingException(String message,
                           Throwable t)
Construct a new ProcessingException that references a parent Exception.


ProcessingException

public ProcessingException(String message,
                           Location location)
Construct a new ProcessingException that has an associated location.


ProcessingException

protected ProcessingException(String message,
                              Throwable t,
                              Location location)
Construct a new ProcessingException that has a parent exception and an associated location.

This constructor is protected to enforce the use of throwLocated(String, Throwable, Location) which limits exception nesting as far as possible.

Method Detail

throwLocated

public static ProcessingException throwLocated(String message,
                                               Throwable thr,
                                               Location location)
                                        throws ProcessingException
Throw a located exception given an existing exception and the location where this exception was catched.

If the exception is already a ProcessingException or a LocatedRuntimeException, the location is added to the original exception's location chain and the original exception is rethrown (description is ignored) to limit exception nesting. Otherwise, a new ProcessingException is thrown, wrapping the original exception.

Note: this method returns an exception as a convenience if you want to keep the throw semantics in the caller code, i.e. write
  throw ProcessingException.throwLocated(...);
instead of
  ProcessingException.throwLocated(...);
  return;

Parameters:
message - a message (can be null)
thr - the original exception (can be null)
location - the location (can be null)
Returns:
a (fake) located exception
Throws:
ProcessingException - or LocatedRuntimeException

throwLocated

public static ProcessingException throwLocated(String message,
                                               Throwable thr,
                                               List locations)
                                        throws ProcessingException
Throw a located exception given an existing exception and the locations where this exception was catched.

If the exception is already a ProcessingException or a LocatedRuntimeException, the locations are added to the original exception's location chain and the original exception is rethrown (description is ignored) to limit exception nesting. Otherwise, a new ProcessingException is thrown, wrapping the original exception.

Note: this method returns an exception as a convenience if you want to keep the throw semantics in the caller code, i.e. write
  throw ProcessingException.throwLocated(...);
instead of
  ProcessingException.throwLocated(...);
  return;

Parameters:
message - a message (can be null)
thr - the original exception (can be null)
locations - the locations (can be null)
Returns:
a (fake) located exception
Throws:
ProcessingException - or LocatedRuntimeException


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.