Lucee 4.5.2 cfhttp inconsistent timeout response with Adobe Coldfusion
Trying to catch a timeout is alwas a problem, particularly on those jumpy sites that are normally ok, but can be offline for an hour or 2 when the owners is asleep!
There is a bug here https://luceeserver.atlassian.net/browse/LDEV-80 but it is not quite the same and I do get a correct response if in the example below sleep(4000) was replaced by a=1/0;
Suppose a file like so:
<cfif structkeyexists(url, "test")>
<cfscript>sleep(4000);</cfscript>
<cfelse>
<cftry>
<cfhttp timeout="2" url="http://#cgi.http_host##cgi.script_name#?test" throwonerror="true" result="x" />
<cfcatch type="any"> <cfdump var="#x#" />
<cfdump var="#cfcatch#" />
</cfcatch>
</cftry>
</cfif>
Lucee 4.5.2 produces
Struct | |||
errordetail |
|
while the cfcatch adds in this
statusCode |
| ||
statusText |
|
while Adobe CF populates x as follows with no mention of status codes in the cfcatch
Charset | [empty string] | ||
ErrorDetail | [empty string] | ||
Filecontent | Connection Timeout | ||
Header | [empty string] | ||
Mimetype | Unable to determine MIME type of file. | ||
Responseheader |
| ||
Statuscode | 408 Request Time-out | ||
Text | YES |
I guess you could search the error details for the phrase "timeout" as that is the only consistent thing between the 2 engines.
Comments
Post a Comment