org.apache.hadoop.lib.lang
Class XException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.apache.hadoop.lib.lang.XException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DelegationTokenManagerException, FileSystemAccessException, ServerException

@InterfaceAudience.Private
public class XException
extends Exception

Generic exception that requires error codes and uses the a message template from the error code.

See Also:
Serialized Form

Nested Class Summary
static interface XException.ERROR
          Interface to define error codes.
 
Constructor Summary
XException(XException.ERROR error, Object... params)
          Creates an XException using the specified error code.
XException(XException cause)
          Creates an XException using another XException as cause.
 
Method Summary
 XException.ERROR getError()
          Returns 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)
Creates an XException using another XException as cause.

The error code and error message are extracted from the cause.

Parameters:
cause - exception cause.

XException

public XException(XException.ERROR error,
                  Object... params)
Creates an XException using the specified error code. The exception message is resolved using the error code template and the passed parameters.

Parameters:
error - error code for the XException.
params - parameters to use when creating the error message with the error code template.
Method Detail

getError

public XException.ERROR getError()
Returns the error code of the exception.

Returns:
the error code of the exception.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.