Skip to content

Instantly share code, notes, and snippets.

@bennadel
Created March 25, 2014 00:28
Show Gist options
  • Save bennadel/9752428 to your computer and use it in GitHub Desktop.
Save bennadel/9752428 to your computer and use it in GitHub Desktop.
Dealing With RequestTimeOut And The OnError Application Event Method (Help Me)
<cfcomponent>
<!--- Set up global page processing. --->
<cfsetting
requesttimeout="5"
showdebugoutput="false"
/>
<cffunction
name="OnError"
access="public"
returntype="void"
output="true">
<p>
You have errored out.
</p>
<p>
Error: #ARGUMENTS[ 1 ].Message#
</p>
</cffunction>
</cfcomponent>
<!---
Set up a bunch of CFHttp calls to force the page to
run longer than the set request time out.
--->
<cfhttp url="http://www.google.com?q=#Rand()#" />
<cfhttp url="http://www.yahoo.com?q=#Rand()#" />
<cfhttp url="http://www.cnn.com?q=#Rand()#" />
<cfhttp url="http://www.searchgalleries.com?q=#Rand()#" />
<cfhttp url="http://www.espn.com?q=#Rand()#" />
<cfhttp url="http://www.houseoffusion.com?q=#Rand()#" />
<cfhttp url="http://www.fullasagoog.com?q=#Rand()#" />
<cfhttp url="http://www.ask.com?q=#Rand()#" />
<cfhttp url="http://www.cnet.com?q=#Rand()#" />
<!--- Success! --->
Done grabbing content.
<cffunction
name="OnError"
access="public"
returntype="void"
output="true">
<p>
You have errored out.
</p>
<p>
Error: #ARGUMENTS[ 1 ].Message#
</p>
<!--- Dump out the error arguments. --->
<cfdump
var="#ARGUMENTS[ 1 ]#"
top="1"
/>
</cffunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment