org.apache.oozie
Class XException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.apache.oozie.XException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AuthorizationException, BaseEngineException, BundleJobException, CommandException, CoordinatorJobException, CredentialException, JPAExecutorException, ParameterVerifierException, PreconditionException, ServiceException, StoreException, URIHandlerException, WorkflowException

public class XException
extends Exception

Base exception for all Oozie exception.

It requires error codes an captures the Log info at exception time.

Error codes should be modeled in subclasses as Enums.

See Also:
Serialized Form

Constructor Summary
XException(ErrorCode errorCode, Object... params)
          Create an EXception from an error code plus parameter to create the exception message.
XException(XException cause)
          Create an XException from a XException.
 
Method Summary
 ErrorCode getErrorCode()
          Return the error code of the exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XException

public XException(XException cause)
Create an XException from a XException.

Parameters:
cause - the XException cause.

XException

public XException(ErrorCode errorCode,
                  Object... params)
Create an EXception from an error code plus parameter to create the exception message.

The value of ErrorCode.getTemplate() is used as a StringFormat template for the exception message.

If the last parameter is an Exception it is used as the exception cause.

Parameters:
errorCode - the error code for the exception.
params - parameters used to create the exception message together with the error code template. If the last parameter is an Exception it is used as the exception cause.
Method Detail

getErrorCode

public ErrorCode getErrorCode()
Return the error code of the exception.

Returns:
exception error code.


Copyright © 2013 Apache Software Foundation. All Rights Reserved.