Indigo Rose Software

Go Back   Indigo Rose Software Forums > Old Versions > TrueUpdate 2.0

 
 
Thread Tools Display Modes
  #1  
Old 03-16-2005
Ken Gartner Ken Gartner is offline
Forum Member
 
Join Date: Feb 2005
Posts: 14
Bug? Http download error not recorded by GetHTTPErrorInfo()

The trouble ticket submission page does not allow selection of TU 2.0, so I'll post this here. I am running 2.0.0.0 on Windows XP.

HTTP file download has failed, but the GetHTTPErrorInfo() does not contain correct information in my test scenario.

My code resembles the example code for GetHTTPErrorInfo:

=================
-- Download the latest patch file, locally
local RemotePatchTOCFileURL = _DOWNLOAD_URLBASE.."/PatchTOC.ini";
local LocalPatchTOCFileName = _SourceFolder.."\\PatchTOC.ini";

TrueUpdate.WriteToLogFile("About to download from "..RemotePatchTOCFileURL.." to local "..LocalPatchTOCFileName.."\r\n", true);

HTTP.Download(RemotePatchTOCFileURL, LocalPatchTOCFileName);
if (Application.GetLastError() ~= 0) then
local httpStatus = HTTP.GetHTTPErrorInfo();

TrueUpdate.WriteToLogFile("HTTP Download Error "..httpStatus.Number.." while retrieving Patch TOC\r\n", true);
TrueUpdate.WriteToLogFile(httpStatus.Message.."\r\ n", true);
end

================

Since an error was generated, the example shows that GetHTTPErrorInfo() should be called to retrieve the info about it. However, the HTTP download information is 'stale' or incorrect -- at least for me it shows the following in my log file:

================
[03/16/2005 07:10:11] About to download from http://gartner.dysanalytics.com/ecde...s/PatchTOC.ini to local C:\temp\ECDE0304B\ECDE_5.0\templates\PatchTOC.ini
[03/16/2005 07:10:11] Error Script: Server Script, [130]: HTTP.Download(RemotePatchTOCFileURL, LocalPatchTOCFileName); (2515)
[03/16/2005 07:10:12] HTTP Download Error 0 while retrieving Patch TOC
[03/16/2005 07:10:12] The operation completed successfully.
=================

This might be a documentation or product error. Can you clarify when GetHTTPErrorInfo() holds the proper error condition information, and when should I rely solely upon the Application.GetLastError() instead?

Thanks.

Ken Gartner
  #2  
Old 03-16-2005
Mark's Avatar
Mark Mark is offline
Indigo Rose Staff Member
 
Join Date: Jun 2000
Location: Indigo Rose Software
Posts: 1,773
Hi Ken,

I have made a note about TrueUpdate 2.0 not being available as an option when you try to submit a ticket, so it should be fix as soon as possible.

Now with regards to the problem that you are having, it turns out that this is a bit of a problem with our documentation. If you look in the help file you will see that HTTP.GetHTTPErrorInfo(); returns 3 things in a table:

Number - A WinInet error code
Message - The WinInet error message, associated with that code.
Status - The HTTP Status code returned by the server

In your case what is happening is you are getting a 404 error, file not found, which is a status code returned by the server. So in that case the Number value will be 0 and the Message value will be "The operation completed successfully".

The reason for that is because everything actually worked properly, i.e. getting and Internet connection, connecting to the server and things like that. But when we tried to get the actually file, the Server returned the 404 status, saying that it could not find the file.

If you had an additional line in your if block like this:

Code:
TrueUpdate.WriteToLogFile("HTTP status: "..httpStatus.Status.."\r\n", true);
Then you will be logging all of the information returned by HTTP.GetHTTPErrorInfo().

I have also submitted this to be fixed in our documentation.
__________________
MSI Factory The Next Generation Intelligent Setup Builder
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
http download rhosk AutoPlay Media Studio 5.0 4 01-16-2004 07:24 PM
HOWTO: Download and Install Files from the Web Support Setup Factory 6.0 Knowledge Base 0 10-23-2002 02:16 PM
HTTP download problem skameni Setup Factory 6.0 3 09-12-2002 03:17 PM
HTTP download, no https support? damian Setup Factory 6.0 1 05-28-2002 09:44 AM


All times are GMT -6. The time now is 05:36 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software