org.apache.hcatalog.common
Class HCatException

Object
  extended by Throwable
      extended by Exception
          extended by IOException
              extended by HCatException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConnectionFailureException, ObjectNotFoundException

public class HCatException
extends IOException

Class representing exceptions thrown by HCat.

See Also:
Serialized Form

Constructor Summary
HCatException(ErrorType errorType)
          Instantiates a new hcat exception.
HCatException(ErrorType errorType, String extraMessage)
          Instantiates a new hcat exception.
HCatException(ErrorType errorType, String extraMessage, Throwable cause)
          Instantiates a new hcat exception.
HCatException(ErrorType errorType, Throwable cause)
          Instantiates a new hcat exception.
HCatException(String message)
          Instantiates a new hcat exception.
HCatException(String message, Throwable cause)
          Instantiates a new hcat exception.
 
Method Summary
static String buildErrorMessage(ErrorType type, String extraMessage, Throwable cause)
          Builds the error message string.
 int getErrorCode()
          Gets the error code.
 ErrorType getErrorType()
          Gets the error type.
 boolean isRetriable()
          Is this a retriable error.
 String toString()
           
 
Methods inherited from class Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HCatException

public HCatException(ErrorType errorType)
Instantiates a new hcat exception.

Parameters:
errorType - the error type

HCatException

public HCatException(ErrorType errorType,
                     Throwable cause)
Instantiates a new hcat exception.

Parameters:
errorType - the error type
cause - the cause

HCatException

public HCatException(ErrorType errorType,
                     String extraMessage)
Instantiates a new hcat exception.

Parameters:
errorType - the error type
extraMessage - extra messages to add to the message string

HCatException

public HCatException(ErrorType errorType,
                     String extraMessage,
                     Throwable cause)
Instantiates a new hcat exception.

Parameters:
errorType - the error type
extraMessage - extra messages to add to the message string
cause - the cause

HCatException

public HCatException(String message)
Instantiates a new hcat exception.

Parameters:
message - the error message

HCatException

public HCatException(String message,
                     Throwable cause)
Instantiates a new hcat exception.

Parameters:
message - the error message
cause - the cause
Method Detail

buildErrorMessage

public static String buildErrorMessage(ErrorType type,
                                       String extraMessage,
                                       Throwable cause)
Builds the error message string. The error type message is appended with the extra message. If appendCause is true for the error type, then the message of the cause also is added to the message.

Parameters:
type - the error type
extraMessage - the extra message string
cause - the cause for the exception
Returns:
the exception message string

isRetriable

public boolean isRetriable()
Is this a retriable error.

Returns:
is it retriable

getErrorType

public ErrorType getErrorType()
Gets the error type.

Returns:
the error type enum

getErrorCode

public int getErrorCode()
Gets the error code.

Returns:
the error code

toString

public String toString()
Overrides:
toString in class Throwable