com.wm.app.b2b.client
Class ServiceException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.wm.util.LocalizedException
              extended by com.wm.lang.ns.NSException
                  extended by com.wm.app.b2b.client.ServiceException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AccessException, DeliveryException, InvalidRequestException, TXException

public class ServiceException
extends NSException

This is a general exception thrown when a service fails. When the server throws an exception that does not exist on the client, ServiceException contains the name and text message of the error from the server.

See Also:
AccessException, DeliveryException, InvalidRequestException, TXException, Serialized Form

Constructor Summary
ServiceException()
          Constructs a ServiceException with no detailed error message.
ServiceException(java.lang.String msg)
          Constructs a ServiceException with the specified message.
ServiceException(java.lang.String msg, java.lang.String eType)
          Constructs a ServiceException with the specified message and error type.
ServiceException(java.lang.String msg, java.lang.String eType, java.lang.String eDump)
          Constructs a ServiceException with a specified message, error type, and an error dump.
ServiceException(java.lang.Throwable t)
          Constructs a ServiceException using the specified Throwable object as input.
ServiceException(Values in)
          Constructs a ServiceException using the specified Values object as input.
 
Method Summary
 java.lang.String getErrorDump()
          Returns the error dump from this ServiceException.
 Values getErrorInfo()
          Returns the error information contained in this ServiceException object as a Values object.
 java.lang.String getErrorType()
          Returns this ServiceException object's error type.
 java.lang.String getLocalizedMessage()
          Following copied from class: com.wm.util.LocalizedException
 java.lang.String getMessage()
          Returns this ServiceException object's detailed error message.
 java.lang.Exception getOriginalException()
          Attempts to construct, on the client, an instance of the same exception that was originally thrown by the server.
 void reThrow()
          Attempts to construct and throw, on the client, an instance of the same exception that was originally thrown by the server.
 java.lang.String toString()
          Returns this ServiceException as a string.
 
Methods inherited from class com.wm.util.LocalizedException
getErrorDetails, getLocalizedMessage, getMsgId, getMsgOnly, getMsgOnly, getWrappedException, setErrorDetails
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceException

public ServiceException()
Constructs a ServiceException with no detailed error message.


ServiceException

public ServiceException(java.lang.String msg)
Constructs a ServiceException with the specified message.

Parameters:
msg - A String specifying the detailed error message for this ServiceException.

ServiceException

public ServiceException(java.lang.String msg,
                        java.lang.String eType)
Constructs a ServiceException with the specified message and error type.

Parameters:
msg - A String specifying the detailed error message for this ServiceException.
eType - A String specifying the error type for this ServiceException (for example, "java.lang.ArrayIndexOutOfBoundsException").

ServiceException

public ServiceException(java.lang.String msg,
                        java.lang.String eType,
                        java.lang.String eDump)
Constructs a ServiceException with a specified message, error type, and an error dump.

Parameters:
msg - A String specifying the detailed error message for this ServiceException.
eType - A String specifying the error type for this ServiceException.
eDump - A String specifying the error dump.

ServiceException

public ServiceException(Values in)
Constructs a ServiceException using the specified Values object as input.

Parameters:
in - A Values object that contains error information.

ServiceException

public ServiceException(java.lang.Throwable t)
Constructs a ServiceException using the specified Throwable object as input.

Parameters:
t - A Throwable object that contains error information.
Method Detail

getErrorDump

public java.lang.String getErrorDump()
Returns the error dump from this ServiceException.

Returns:
A String containing the error dump. If this ServiceException doesn't contain an error dump, this method returns null.

getErrorInfo

public Values getErrorInfo()
Returns the error information contained in this ServiceException object as a Values object.

Returns:
A Values object containing the error information.

getErrorType

public java.lang.String getErrorType()
Returns this ServiceException object's error type.

Returns:
A String containing the error type.

getMessage

public java.lang.String getMessage()
Returns this ServiceException object's detailed error message.

Overrides:
getMessage in class LocalizedException
Returns:
A String containing the error message.

getLocalizedMessage

public java.lang.String getLocalizedMessage()
Following copied from class: com.wm.util.LocalizedException

Overrides:
getLocalizedMessage in class LocalizedException
Returns:
localized message String using the default locale of the JVM.

getOriginalException

public java.lang.Exception getOriginalException()
Attempts to construct, on the client, an instance of the same exception that was originally thrown by the server. If this exception cannot be created on the client, then getOrginalException returns the ServiceException.

Returns:
A new instance of the same Exception thrown by the server if the client can reconstruct that exception. If that exception cannot be constructed, this ServiceException is returned.
See Also:
reThrow()

reThrow

public void reThrow()
             throws java.lang.Exception
Attempts to construct and throw, on the client, an instance of the same exception that was originally thrown by the server. If this exception cannot be created on the client side, then reThrow throws the ServiceException.

Throws:
A - new instance of the same exception thrown by the server if the client can reconstruct that exception. If that exception cannot be constructed, this ServiceException is thrown.
java.lang.Exception
See Also:
getOriginalException()

toString

public java.lang.String toString()
Returns this ServiceException as a string.

Overrides:
toString in class java.lang.Throwable
Returns:
A String representation of this ServiceException.