OverviewExamples
table HTTP.GetHTTPErrorInfo ( |
) |
ErrInfo = HTTP.GetHTTPErrorInfo();
Gets the last HTTP error info and stores it in table ErrInfo.
HTTP.Download("http://www.asitehere.com/file.ext", "c:\\file.ext",MODE_BINARY, 20, 80, nil, nil, nil);
if (Application.GetLastError() ~= 0) then
local http_error = HTTP.GetHTTPErrorInfo();
local error_text = http_error.Message .. "\r\nServer Status: " .. http_error.Status;
Dialog.Message("HTTP Error: " .. http_error.Number, error_text, MB_OK, MB_ICONEXCLAMATION);
end
Downloads a file. If an error occurs, displays the extended HTTP error information.
HTTP.Download("http://www.asitehere.com/file.ext", "c:\\file.ext",MODE_BINARY, 20, 80, nil, nil, nil);
local http_error = HTTP.GetHTTPErrorInfo();
if (http_error.Status < 200 or http_error.Status > 299) then
-- Write the HTTP error info into the log file
SetupData.WriteToLogFile("HTTP Download Error Info: " .. http_error.Number .. " - " .. http_error.Message, true);
SetupData.WriteToLogFile("HTTP Download Server Status: " .. http_error.Status, true);
end
Downloads a file. If the server status indicates that an error occurred, makes an entry in the installation log file.
See also: Related Actions