org.openanzo.common.exceptions
Class AnzoException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.openanzo.common.exceptions.AnzoException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DBException, NotificationException, ProxyGraphException, ReplicationException, RepositoryException, ServerException, TransactionGraphException, TransportException, UpdateServerException

public class AnzoException
extends java.lang.Exception

Base exception for Anzo. Contains an major error code, a minor code, and any arguments needed to populate the exception message. The text of the message is stored in an external properties file in order to facilitate i8n.

Author:
Matthew Roy ( mroy@cambridgesemantics.com )
See Also:
Serialized Form

Method Summary
static AnzoException createException(org.apache.axis.AxisFault fault)
          Create a new exception with an AxisFault as the cause.
static AnzoException createException(int errorCode, int errorSubCode, java.lang.String... args)
          Create a new exception with a Major and Minor code, and 0 or more string arguments to the error message.
static AnzoException createException(int errorCode, int errorSubCode, java.lang.Throwable cause, java.lang.String... args)
          Create a new exception with a Major and Minor code, and 0 or more string argurments to the error message.
 java.lang.String[] getArgs()
          Get the arguments to the error message
 int getErrorCode()
          Get the major code.
 int getErrorSubCode()
          Get the minor code.
 java.lang.String getMessage()
          Return the error message for this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createException

public static AnzoException createException(int errorCode,
                                            int errorSubCode,
                                            java.lang.String... args)
Create a new exception with a Major and Minor code, and 0 or more string arguments to the error message.

Parameters:
errorCode - Major code
errorSubCode - Minor code
args - Arguments to error message
Returns:
New AnzoException based on given error codes and arguments

createException

public static AnzoException createException(int errorCode,
                                            int errorSubCode,
                                            java.lang.Throwable cause,
                                            java.lang.String... args)
Create a new exception with a Major and Minor code, and 0 or more string argurments to the error message.

Parameters:
errorCode - Major code
errorSubCode - Minor code
cause - Cause of exception
args - Arguments to error message
Returns:
New AnzoException based on given error codes and arguments

createException

public static AnzoException createException(org.apache.axis.AxisFault fault)
Create a new exception with an AxisFault as the cause. If its a AnzoAxisFault, pull out the major,minor and args.

Parameters:
fault - Cause of the exception
Returns:
New AnzoException based on given error codes and arguments

getMessage

public java.lang.String getMessage()
Return the error message for this exception.

Overrides:
getMessage in class java.lang.Throwable
Returns:
error message for this exception

getErrorCode

public int getErrorCode()
Get the major code.

Returns:
Error's major code

getErrorSubCode

public int getErrorSubCode()
Get the minor code.

Returns:
Error's minor code

getArgs

public java.lang.String[] getArgs()
Get the arguments to the error message

Returns:
arguments to the error message


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.