Sorcerer's IsleCode QueryParam Scanner / files

 1<cfif StructKeyExists(Request,'Exception')>
 2
 3	<cfif StructKeyExists(rc,'OutputFormat') AND NOT StructKeyExists(rc,'Debug')>
 4		<cfset ExceptionData =
 5			{ 'Type'    = Request.Exception.Cause.Type
 6			, 'Message' = Request.Exception.Cause.Message
 7			}/>
 8		<cfif StructKeyExists(Request.Exception.Cause,'TagContext')
 9			AND ArrayLen(Request.Exception.Cause.TagContext)
10			>
11			<cfset ExceptionData['RawTrace'] = Request.Exception.TagContext[1].raw_trace />
12		</cfif>
13
14		<cfswitch expression=#rc.OutputFormat#>
15			<cfcase value="JSON">
16				<cfcontent type="application/json"/><cfoutput>#serializeJson(ExceptionData)#</cfoutput>
17			</cfcase>
18			<cfcase value="WDDX">
19				<cfcontent type="text/xml"/><cfwddx action="cfml2wddx" input="#ExceptionData#"/>
20			</cfcase>
21			<cfcase value="XML"><cfcontent reset type="text/xml"/><cfoutput><?xml version="1.0" encoding="UTF-8"?>
22				<qpscanner><error type="#XmlFormat(ExceptionData.Type)#">
23				<message>#XmlFormat(ExceptionData.Message)#</message>
24				<cfif StructKeyExists(ExceptionData,'RawTrace')
25				><raw-trace>#XmlFormat(ExceptionData.RawTrace)#</raw-trace></cfif>
26				</error></qpscanner></cfoutput>
27			</cfcase>
28			<cfdefaultcase>
29				<cfoutput><p class="error">
30					<b>Error: #HtmlEditFormat(ExceptionData.Message)#</b>
31					<br/>Type: #HtmlEditFormat(ExceptionData.Type)#
32					<cfif StructKeyExists(ExceptionData,'RawTrace')
33					><br/>RawTrace: #HtmlEditFormat(ExceptionData.RawTrace)#</cfif>
34				</p></cfoutput>
35			</cfdefaultcase>
36		</cfswitch>
37
38	<cfelse>
39		<cfdump var=#Request.Exception# />
40	</cfif>
41<cfelse>
42	No Exception?
43</cfif>