GetLastErrorInfo

From Solid Graphics Wiki

Jump to: navigation, search
GetLastErrorInfo
Namespace: SKL
Member of: (this function is not member of any class)
Include: SklErrorInfo.h
Lib (Release): SKL.lib
Lib (Debug): SKL_D.lib

The GetLastErrorInfo returns textual information about the last error encountered in a SolidKit library function.

void GetLastErrorInfo
         (
         String & errSource,
         String & errDescription,
         bool resetErrorInfo = true
         );


Parameters

errSource When the function returns the errSource variable will contain information about the source of the error - for example for the SKL::File::OpenTextFile function call error the errSource will be set to "SKL::File::OpenTextFile".
errDescription When the function returns the errDescription variable will contain description of the error - for example if you specify "Hello.txt" file as parameter of the SKL::File::OpenTextFile function and the file does not exist then the errDescription text will be set to will be set to "Cannot open 'Hello.txt' file for reading".
resetErrorInfo Flag indicating whether the error information should be reset to empty strings after the GetLastErrorInfo function returns the error info. If true then the error info will be reset, if false then the error info will be kept.

Remarks

Not all SolidKit library functions are setting the error info and none of the SolidKit functions are setting it if the function ran without errors. If you want to be sure whether the returned error info is relevant for the function you are calling (or group of functions) - you can reset the error info to empty strings using the SetLastErrorInfo function before you call your functions - and then check whether values returned by GetLastErrorInfo function are not still empty - if not then the error info was set by one of the functions you called after the resetting the error info by the SetLastErrorInfo function.

See Also


   


SolidKit Library Documentation

Personal tools