Operating system errors

From RAD Studio
Jump to: navigation, search

Go Up to Delphi Compiler Errors Index

All errors other than I/O errors and fatal errors are reported with the error codes returned by the operating system.

OS error codes

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 System.GetLastError function. If you want to raise an exception rather than fetch the error code for the last API call that failed, call the SysUtils.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 System.SysUtils.SysErrorMessage function.

Getting return values

To check the return value from a Win32 API function call and raise an EWin32Error exception if it represents an error, call the global System.SysUtils.Win32Check function.

See Also