com.cloudera.lib.lang
Class XException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.cloudera.lib.lang.XException
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- HadoopException, ServerException
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. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
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.
getError
public XException.ERROR getError()
- Returns the error code of the exception.
- Returns:
- the error code of the exception.
Copyright © 2012 Cloudera. All Rights Reserved.