UDT Reference: CUDTException Methods

getErrorMessage

The getErrorMessage method gives the text description of the exception.

char* getErrorMessage(
);

Parameters

NONE.

Return Values

Text string describing the exception or error.

Exceptions

No exception will be caused.

Description

The getErrorMessage method is used to provide simple description of the exception or error. To provide information to the program, getErrorNo should be used.

Examples

This example code shows how to detect exception and output the error information:

CUDT udt;

 

try

{

   //do some UDT operations, e.g., udt.send(data, len);

}

catch (CUDTException e)

{

   cout << "error happens: " << e.getErrorMessage() << endl;

   // process exceptions
};

catch (...)

{

   cout << "unknown error happens, program exit." << endl;

   return;

}

See Also

getErrorNo