[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error SetError() #66:
Scott, I put in this code but there was no change. The same exact
small one line in the error log file. No *escape messages. Perhaps I
should move the new code to another place in the program?
--- On Mon, 7/7/08, Scott Klement <klemscot@xxxxxxxxxxxx> wrote:
From: Scott Klement <klemscot@xxxxxxxxxxxx>
Subject: Re: Error SetError() #66:
To: "HTTPAPI and FTPAPI Projects" <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Date: Monday, July 7, 2008, 9:22 PM
Hi Adam,
Unfortunately, you haven't provided enough detail for me to help you. I
assume that you are still using Craig Jabobsen's code, correct? If so,
there's one point at which he uses HTTPAPI to download a file by calling
the http_url_get() API. The code looks like this (I've removed the
comments so we can focus on the code):
--
Url = 'http://xurrency.com/usd/feed';
FileName = Http_TempFile() + '.xml';
RetCode = Http_Url_Get(Url : FileName );
If RetCode <> 1;
UnLink(FileName);
EndIf;
If Http_Parse_XML_Stmf( FileName
: HTTP_XML_CALC
: *Null
: %PAddr(Incoming)
: *Null )
< 0;
EndIf;
--
The problem with this code is that it does not do proper error handling.
If an error occurs during http_url_get(), it erases the temp file, but
does not stop the program! It continues to call the HTTP_Parse_XML_Stmf().
The problem with that idea is that http_parse_xml_stmf() will wipe out
the debug file that was created by http_url_get() -- so you don't have
any diagnostics.
So, after http_url_get() fails, it deletes the XML file, then deletes
the debug file, so you're really left with no information about the
problem. This is the code that's teh culprit:
If RetCode <> 1;
UnLink(FileName);
EndIf;
The easiest fix is to change the above code to look like the following:
If RetCode <> 1;
UnLink(FileName);
http_crash();
EndIf;
The http_crash() API will abort the program with an *ESCAPE message when
it fails. You can use the data in that escape message, in addition to
the data in the /tmp/httpapi_debug.txt file to determine what the
problem is.
Try making that change and see if there's more info in the
/tmp/httpapi_debug.txt file...?
Adam West wrote:
> I have these 2 coded:
>
> H Option(*SrcStmt:*NoDebugIO) Debug(*Yes)
>
> // debug (ifs subdir tmp/httpapi_debug.txt if on)
> Http_Debug(*On);
>
>
> I do not know how to find this questionable character.I am not getting
> any other document or line in the IFD tmp file.
>
>
> THe code has this in it but it is not getting generated
>
>
> // create a tempory file in subdirectory tmp in the ifs
> FileName = Http_TempFile() + '.xml';
>
>
>
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mike Krebs
> Sent: Monday, July 07, 2008 4:34 PM
> To: 'HTTPAPI and FTPAPI Projects'
> Subject: RE: Error SetError() #66:
>
>
> What is the character at position 54 of the xml?
>
>
> Did you turn on debug? You should get much more that one entry if you
> turn
>
> on debug.
>
>
>
> ------------------------------------------------------------------------
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list. To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------