WebSphere Message Service Client for C/C++, Version 2.0.2 Operating Systems: AIX, Linux, Solaris, Windows

Exception

If XMS detects an error while processing a call to a method, XMS throws an exception. An exception is an object that encapsulates information about the error.

Inheritance hierarchy:
std::exception
   |
   +----xms::Exception

There are different types of XMS exception, and an Exception object is just one type of exception. However, the Exception class is a superclass of the other XMS exception classes. XMS throws an Exception object in situations where none of the other types of exception are appropriate.

Methods

Summary of methods:
Method Description
~Exception Delete the exception and any linked exceptions.
dump Dump the exception to the specified C++ output stream as formatted text.
getErrorCode Get the error code.
getErrorData Get the free format data that provides additional information about the error.
getErrorString Get the string of characters that describes the error.
getHandle Get the handle for the internal error block that XMS creates for the exception.
getJMSException Get the exception code.
getLinkedException Get a pointer to the next exception in the chain of exceptions.
isNull Determine whether the Exception object is a null object.

~Exception – Delete Exception

Interface:
virtual ~Exception() throw();

Delete the exception and any linked exceptions.

Parameters:
None
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

dump – Dump Exception

Interface:
xmsVOID dump(std::ostream outputStream) const;

Dump the exception to the specified C++ output stream as formatted text.

Parameters:
outputStream (input)
The C++ output stream.
Returns:
Void
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

getErrorCode – Get Error Code

Interface:
xmsINT getErrorCode() const;

Get the error code.

Parameters:
None
Returns:
The error code.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

getErrorData – Get Error Data

Interface:
String getErrorData() const;

Get the free format data that provides additional information about the error.

Parameters:
None
Returns:
A String object encapsulating the error data.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

getErrorString – Get Error String

Interface:
String getErrorString() const;

Get the string of characters that describes the error. The characters in the string are the same as those in the named constant that represents the error code.

Parameters:
None
Returns:
A String object encapsulating the error string.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

getHandle – Get Handle

Interface:
xmsHErrorBlock getHandle() const;

Get the handle for the internal error block that XMS creates for the exception.

Parameters:
None
Returns:
The handle for the error block.
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

getJMSException – Get Exception Code

Interface:
xmsJMSEXP_TYPE getJMSException() const;

Get the exception code.

Parameters:
None
Returns:
The exception code.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

getLinkedException – Get Linked Exception

Interface:
Exception * getLinkedException() const;

Get a pointer to the next exception in the chain of exceptions.

Parameters:
None
Returns:
A pointer to an exception. The method returns a null pointer if there are no more exceptions in the chain.
Note: Because the getLinkedException() method returns a pointer to a linked exception, the application must release the object using the C++ delete operator.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

isNull – Check Whether Null

Interface:
xmsBOOL isNull() const;

Determine whether the Exception object is a null object.

Parameters:
None
Returns:
  • xmsTRUE, if the Exception object is a null object.
  • xmsFALSE, if the Exception object is not a null object.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

Reference topic

Terms of Use | Rate this page

Last updated: 24 May 2011

(C) Copyright IBM Corporation 2005, 2011. All Rights Reserved.