I'm trying to search a HTTP reply for some string that is optional, that is it can be or it can be not present in the reply document. In both cases I want the script to go on without generating an error. I found the following code example in the Language Reference Manual:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
DO_Http("GET HTTP://www.yahoo.com HTTP/1.0\r\n"
"User-Agent: Mozilla/3.01 WinNT;I)\r\n"
p = DO_GetUniqueString( "text to the left side of the string",
"text to the right side of the string" );
if (p != NULL )
strcpy( temp, p );
free( p );
RR__printf( "String value = %s", temp );</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">The example looks fine, it seems to do exactly what I need: look up a string, and continue depending on the result.
The problem is that DO_GetUniqueString generates a transaction error if a search failed. This is not nice at all because the failed search is not an error in my case, it's just a local status, but I don't see how to protect this local information from the transaction's context.
I don't see any error handling related directives. This DO_GetUniqueString function seems to be at the lowest possible level. Switching off error handling on the script configuration level does no good, you can't get catch real errors then, and statistics is polluted with "not real" errors.
Can somebody recommend a way to investigate a reply document without rising an error?