com.cybersource.ws.client
Class ClientException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.cybersource.ws.client.ClientException
All Implemented Interfaces:
java.io.Serializable

public class ClientException
extends java.lang.Exception

Exception class used by both Basic and XML clients.

See Also:
Serialized Form

Constructor Summary
ClientException(java.lang.Exception _innerException, boolean _critical, Logger logger)
          Constructor.
ClientException(java.lang.Exception _innerException, Logger logger)
          Constructor.
ClientException(int _httpStatusCode, Logger logger)
          Constructor.
ClientException(int _httpStatusCode, java.lang.String _httpError, boolean _critical, Logger logger)
          Constructor.
ClientException(int _httpStatusCode, java.lang.String _httpError, Logger logger)
          Constructor.
 
Method Summary
 java.lang.String getHttpError()
          Returns additional HTTP error information, if any.
 int getHttpStatusCode()
          Returns the HTTP status code, if any.
 java.lang.Exception getInnerException()
          Returns the actual exception that occurred, if any.
 java.lang.String getMessage()
          Returns a description of the exception.
 boolean isCritical()
          Returns whether or not this exception is critical.
 
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

ClientException

public ClientException(java.lang.Exception _innerException,
                       Logger logger)
Constructor.

Parameters:
_innerException - the actual exception that occurred.
logger - used to log the exception details.

ClientException

public ClientException(java.lang.Exception _innerException,
                       boolean _critical,
                       Logger logger)
Constructor.

Parameters:
_innerException - the actual exception that occurred.
_critical - flag that tells whether or not the exception occurred at a critical point in the transaction.
logger - used to log the exception details.

ClientException

public ClientException(int _httpStatusCode,
                       Logger logger)
Constructor.

Parameters:
_httpStatusCode - HTTP status code
logger - used to log the exception details.

ClientException

public ClientException(int _httpStatusCode,
                       java.lang.String _httpError,
                       Logger logger)
Constructor.

Parameters:
_httpStatusCode - HTTP status code
_httpError - Additional HTTP error information; may be null.
logger - used to log the exception details.

ClientException

public ClientException(int _httpStatusCode,
                       java.lang.String _httpError,
                       boolean _critical,
                       Logger logger)
Constructor.

Parameters:
_httpStatusCode - HTTP status code
_httpError - Additional HTTP error information; may be null.
_critical - flag that tells whether or not the exception occurred at a critical point in the transaction.
logger - used to log the exception details.
Method Detail

getInnerException

public java.lang.Exception getInnerException()
Returns the actual exception that occurred, if any.

Returns:
the actual exception that occurred or null if this object was constructed using an HTTP status code.

isCritical

public boolean isCritical()
Returns whether or not this exception is critical. It will return true in the following cases:

Returns:
whether or not this exception is critical.

getHttpStatusCode

public int getHttpStatusCode()
Returns the HTTP status code, if any.

Returns:
the HTTP status code or -1 if this object was constructed using an actual exception that occurred.

getHttpError

public java.lang.String getHttpError()
Returns additional HTTP error information, if any.

Returns:
additional HTTP error information or null if this object was constructed using an actual exception that occurred.

getMessage

public java.lang.String getMessage()
Returns a description of the exception.

Overrides:
getMessage in class java.lang.Throwable
Returns:
a description of the exception.


Copyright © 2017. All Rights Reserved.