nl.toolforge.karma.core
Class KarmaException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bynl.toolforge.karma.core.KarmaException
All Implemented Interfaces:
java.io.Serializable

public class KarmaException
extends java.lang.Exception

Version:
$Id: KarmaException.java,v 1.34 2004/10/04 11:43:22 asmedes Exp $
Author:
D.A. Smedes
See Also:
Serialized Form

Field Summary
static ErrorCode DEFAULT_CONFIGURATION_CREATED
          Default configuration has been created.
static ErrorCode DEVELOPMENT_HOME_NOT_FOUND
          No development home directory could be referenced to.
protected  ErrorCode errorCode
           
static java.lang.String EXCEPTION_PREFIX
           
static ErrorCode LOCATION_STORE_NOT_FOUND
          When the location store directory could not be found.
static ErrorCode LOCATION_STORE_UPDATE_FAILED
          When updating the location store failed.
static ErrorCode MANIFEST_STORE_NOT_FOUND
          When the manifest store directory could not be found.
static ErrorCode MANIFEST_STORE_UPDATE_FAILED
          When updating the manifest store failed.
protected  java.lang.Object[] messageArguments
           
static ErrorCode MISSING_CONFIGURATION
          Vital configuration is missing
static ErrorCode NO_MAVEN_PROJECT_XML
          The build of a module failed.
static ErrorCode NOT_IMPLEMENTED
          Can be used to identify something that is not implemented
static ErrorCode WORKING_CONTEXT_NOT_FOUND
           
 
Fields inherited from class java.lang.Exception
 
Constructor Summary
KarmaException(ErrorCode errorCode)
          Create a new KarmaException, with the specific errorCode.
KarmaException(ErrorCode errorCode, java.lang.Object[] messageArguments)
          Create a new KarmaException, with the specific errorCode and messageArguments.
KarmaException(ErrorCode errorCode, java.lang.Object[] messageArguments, java.lang.Throwable t)
          Create a new KarmaException, with the specific errorCode and Throwable that caused the exception.
KarmaException(ErrorCode errorCode, java.lang.Throwable t)
          Create a new KarmaException, with the specific errorCode and Throwable that caused the exception.
 
Method Summary
 ErrorCode getErrorCode()
          Gets this instance' ErrorCode.
 java.lang.String getErrorMessage()
          A KarmaException can be constructed with a structured error code ErrorCode.
 java.lang.String getMessage()
           
 java.lang.Object[] getMessageArguments()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXCEPTION_PREFIX

public static final java.lang.String EXCEPTION_PREFIX
See Also:
Constant Field Values

NOT_IMPLEMENTED

public static final ErrorCode NOT_IMPLEMENTED
Can be used to identify something that is not implemented


DEFAULT_CONFIGURATION_CREATED

public static final ErrorCode DEFAULT_CONFIGURATION_CREATED
Default configuration has been created.


MISSING_CONFIGURATION

public static final ErrorCode MISSING_CONFIGURATION
Vital configuration is missing


WORKING_CONTEXT_NOT_FOUND

public static final ErrorCode WORKING_CONTEXT_NOT_FOUND

MANIFEST_STORE_NOT_FOUND

public static final ErrorCode MANIFEST_STORE_NOT_FOUND
When the manifest store directory could not be found.


LOCATION_STORE_NOT_FOUND

public static final ErrorCode LOCATION_STORE_NOT_FOUND
When the location store directory could not be found.


DEVELOPMENT_HOME_NOT_FOUND

public static final ErrorCode DEVELOPMENT_HOME_NOT_FOUND
No development home directory could be referenced to. This is panic, because without it, nothing will work.


MANIFEST_STORE_UPDATE_FAILED

public static final ErrorCode MANIFEST_STORE_UPDATE_FAILED
When updating the manifest store failed.


LOCATION_STORE_UPDATE_FAILED

public static final ErrorCode LOCATION_STORE_UPDATE_FAILED
When updating the location store failed.


NO_MAVEN_PROJECT_XML

public static final ErrorCode NO_MAVEN_PROJECT_XML
The build of a module failed.


errorCode

protected ErrorCode errorCode

messageArguments

protected java.lang.Object[] messageArguments
Constructor Detail

KarmaException

public KarmaException(ErrorCode errorCode)
Create a new KarmaException, with the specific errorCode.

Parameters:
errorCode - The errorCode that identifies the specific error that has occurred.

KarmaException

public KarmaException(ErrorCode errorCode,
                      java.lang.Object[] messageArguments)
Create a new KarmaException, with the specific errorCode and messageArguments.

Parameters:
errorCode - The errorCode that identifies the specific error that has occurred.
messageArguments - These arguments are filled in into the error codes' message.

KarmaException

public KarmaException(ErrorCode errorCode,
                      java.lang.Throwable t)
Create a new KarmaException, with the specific errorCode and Throwable that caused the exception.

Parameters:
errorCode - The errorCode that identifies the specific error that has occurred.
t - The Throwable that caused this specific exception.

KarmaException

public KarmaException(ErrorCode errorCode,
                      java.lang.Object[] messageArguments,
                      java.lang.Throwable t)
Create a new KarmaException, with the specific errorCode and Throwable that caused the exception.

Parameters:
errorCode - The errorCode that identifies the specific error that has occurred.
messageArguments - These arguments are filled in into the error codes' message.
t - The Throwable that caused this specific exception.
Method Detail

getErrorCode

public ErrorCode getErrorCode()
Gets this instance' ErrorCode.

Returns:
This instance' ErrorCode or null if this exception was not initialized with an ErrorCode.

getErrorMessage

public java.lang.String getErrorMessage()
A KarmaException can be constructed with a structured error code ErrorCode. When this is done, the error message will return ErrorCode.getErrorMessage(java.util.Locale) for this exception. If no ErrorCode was used for initialization, the exceptions' getMessage() is returned, so there is always something to tell the developer or user.

Returns:
Return's the ErrorCodes' error message, if the ErrorCode was set, otherwise it will return Throwable.getMessage().

getMessageArguments

public final java.lang.Object[] getMessageArguments()
Returns:
The arguments that are to be filled in into the error codes' message.

getMessage

public java.lang.String getMessage()


Copyright © 2002-2004 Toolforge. All Rights Reserved.