All errors other than I/O errors and fatal errors are reported with the error codes returned by the operating system.
OS error codes are the return value of operating system function calls. You can obtain the error code for the last error that occurred by calling the global GetLastError function. If you want to raise an exception rather than fetch the error code for the last API call that failed, call the RaiseLastOSError procedure instead.
The error code values returned by GetLastError are dependent on the operating system. You can obtain an error string associated with one of these error codes by calling the global SysErrorMessage function.
To check the return value from a Win32 API function call and raise an EWin32Error exception if it represents an error, call the global Win32Check function.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!