nl.toolforge.karma.core.vc.cvsimpl
Class CVSRuntimeException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended bynl.toolforge.karma.core.vc.cvsimpl.CVSRuntimeException
All Implemented Interfaces:
java.io.Serializable

final class CVSRuntimeException
extends java.lang.RuntimeException

This exception is thrown by the CVSResponseAdapter when an error message was received from CVS. The listener mechanism that is used by the Netbeans API sends events to a listener. Succesfull commands to CVS are passed to a CommandResponseHandler, handled by Karma, but we want to be able to throw exceptions when errors have occurred. With a RuntimeException, we have the means to do so.

There is a little trick required to get to fetch this exception. The Netbeans API fetches all RuntimeExceptions and re-throws it as a org.netbeans.lib.cvsclient.command.CommandException. The original (runtime-)exception is kept in its getUnderlyingException()-method, which is thus used to determine if we threw a CVSRuntimeException. Works fine ...

Version:
$Id: CVSRuntimeException.java,v 1.4 2004/11/02 22:26:44 asmedes Exp $
Author:
D.A. Smedes

Field Summary
 
Fields inherited from class java.lang.RuntimeException
 
Constructor Summary
CVSRuntimeException(ErrorCode errorCode)
          Constructs a CVSRuntimeException, with a non-null ErrorCode.
CVSRuntimeException(ErrorCode errorCode, java.lang.Object[] messageArguments)
           
CVSRuntimeException(java.lang.Throwable t, ErrorCode errorCode)
           
CVSRuntimeException(java.lang.Throwable t, ErrorCode errorCode, java.lang.Object[] messageArguments)
           
 
Method Summary
 ErrorCode getErrorCode()
          Gets the exceptions' 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
 

Constructor Detail

CVSRuntimeException

public CVSRuntimeException(ErrorCode errorCode)
Constructs a CVSRuntimeException, with a non-null ErrorCode.

Parameters:
errorCode - An ErrorCode instance. Should not be null (or an IllegalArgumentException will be thrown.

CVSRuntimeException

public CVSRuntimeException(java.lang.Throwable t,
                           ErrorCode errorCode)

CVSRuntimeException

public CVSRuntimeException(ErrorCode errorCode,
                           java.lang.Object[] messageArguments)

CVSRuntimeException

public CVSRuntimeException(java.lang.Throwable t,
                           ErrorCode errorCode,
                           java.lang.Object[] messageArguments)
Method Detail

getMessage

public java.lang.String getMessage()

getErrorCode

public final ErrorCode getErrorCode()
Gets the exceptions' ErrorCode.

Returns:

getMessageArguments

public final java.lang.Object[] getMessageArguments()


Copyright © 2002-2004 Toolforge. All Rights Reserved.