HP LoadRunner Protocol SDK Test Run API Reference  12.02
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
CProtocolException Class Reference

Class CProtocolException represents an exception condition. More...

#include <ProtocolException.h>

Public Member Functions

 CProtocolException (int mErrorCode, va_list mVaList, bool mAbortNoMatterWhat)
 To instantiate an exception, call the private method, ExceptionObject(). More...
 
 CProtocolException (const CProtocolException &other)
 Copy Constructor.
 
virtual ~CProtocolException ()
 Destructor.
 
CProtocolExceptionoperator= (const CProtocolException &other)
 Assignment operator.
 
int GetErrorCode (void)
 Returns the error code.
 
const char * GetErrorMessage (void)
 Returns the error message.
 
bool AbortNoMatterWhat (void)
 Checks whether to abort unconditionally, regardless of continue on error flag value. More...
 

Detailed Description

Class CProtocolException represents an exception condition.

To throw an exception, invoke the ExceptionObject function, for example:

throw ExceptionObject(error code, param1, param2,..)

Constructor & Destructor Documentation

CProtocolException::CProtocolException ( int  mErrorCode,
va_list  mVaList,
bool  mAbortNoMatterWhat 
)

To instantiate an exception, call the private method, ExceptionObject().

ExceptionObject handles encapsulating a variable-length argument list in an object to pass to the constructor.

Note
C++ constructors cannot accept a variable-length argument list. Therefore, the list must be encapsulated.

The method declaration is :

PROTOCOL_EXTENSION_DECLSPEC CProtocolException
bool mAbortNoMatterWhat, // True to ignore the "Continue on error" setting.
int mErrorCode, // Code from an eng file.
... //parameters for variable replacement in the error message.
);

For example:

throw ExceptionObject(ABORT_BY_CONTINUE_ON_ERROR, SDK_INTERNAL_ERROR,
"GetMaxCharacterSizeOfLocale - ucnv_open failed (status=%d)", status);
Parameters
mErrorCodeEither a LoadRunner code, a code from sdk_res.eng, or from your protocol eng file.
mVaListAn object that encapsulates the arguments for variable replacement in the error message.
mAbortNoMatterWhatTrue (ABORT_NO_MATTER_WHAT)to ignore the "Continue on error" setting and abort the Vuser unconditionally. False (ABORT_BY_CONTINUE_ON_ERROR) to abort only if "Continue on error" is off.

Member Function Documentation

bool CProtocolException::AbortNoMatterWhat ( void  )

Checks whether to abort unconditionally, regardless of continue on error flag value.

Returns
ABORT_NO_MATTER_WHAT (true) or ABORT_BY_CONTINUE_ON_ERROR (false).

The documentation for this class was generated from the following file:


Send documentation feedback to HP.


© 1995-2015 Hewlett-Packard Development Company, L.P.