OpenVSPAPI  3.24.0
Functions
API Error Functions

Handeling of OpenVSP ErrorObj information is accomplished through this group of API functions.

Click here to return to the main page. More...

Functions

bool GetErrorLastCallFlag ()
 
int GetNumTotalErrors ()
 
ErrorObj PopLastError ()
 
ErrorObj GetLastError ()
 
void SilenceErrors ()
 
void PrintOnErrors ()
 

Detailed Description

Function Documentation

◆ GetErrorLastCallFlag()

bool GetErrorLastCallFlag ( )

Check if there was an error on the last call to the API

//==== Force API to silence error messages ====//
//==== Bogus Call To Create API Error ====//
Print( string( "---> Test Error Handling" ) );
SetParmVal( "BogusParmID", 23.0 );
if ( !GetErrorLastCallFlag() ) { Print( "---> Error: API GetErrorLastCallFlag " ); }
//==== Tell API to print error messages ====//
Returns
False if no error, true otherwise

◆ GetLastError()

ErrorObj GetLastError ( )

Return the most recent error from the stack (does NOT pop error off the stack)

//==== Force API to silence error messages ====//
Print( "Creating an API error" );
SetParmVal( "ABCDEFG", "Test_Name", "Test_Group", 123.4 );
//==== Check For API Errors ====//
//==== Tell API to print error messages ====//
See also
SilenceErrors, PrintOnErrors;
Returns
Error object

◆ GetNumTotalErrors()

int GetNumTotalErrors ( )

Count the total number of errors on the stack

//==== Force API to silence error messages ====//
Print( "Creating an API error" );
SetParmVal( "ABCDEFG", "Test_Name", "Test_Group", 123.4 );
//==== Check For API Errors ====//
while ( GetNumTotalErrors() > 0 )
{
}
//==== Tell API to print error messages ====//
Returns
Number of errors

◆ PopLastError()

ErrorObj PopLastError ( )

Pop (remove) and return the most recent error from the stack. Note, errors are printed on occurance by default.

//==== Force API to silence error messages ====//
Print( "Creating an API error" );
SetParmVal( "ABCDEFG", "Test_Name", "Test_Group", 123.4 );
//==== Check For API Errors ====//
while ( GetNumTotalErrors() > 0 )
{
}
//==== Tell API to print error messages ====//
Returns
Error object

◆ PrintOnErrors()

void PrintOnErrors ( )

Cuase errors to be printed to stdout as they occur.

//==== Force API to silence error messages ====//
Print( "Creating an API error" );
SetParmVal( "ABCDEFG", "Test_Name", "Test_Group", 123.4 );
//==== Tell API to print error messages ====//
See also
SilenceErrors

◆ SilenceErrors()

void SilenceErrors ( )

Prevent errors from printing to stdout as they occur.

//==== Force API to silence error messages ====//
Print( "Creating an API error" );
SetParmVal( "ABCDEFG", "Test_Name", "Test_Group", 123.4 );
//==== Tell API to print error messages ====//
See also
PrintOnErrors