Try #GetFileFromPath(GetCurrentTemplatePath())#.

Example:
<!--- // index.cfm \\ --->
<cftry>
 <cfinclude template="include.cfm">
 <cfcatch>
  <cfoutput>#CFCATCH.Message#</cfoutput>
 </cfcatch>
</cftry>
<!--- \\ index.cfm // --->

<!--- // include.cfm \\ --->
<cftry>
 <cfthrow type="CustomError" message="Error occured in file:
#GetFileFromPath(GetCurrentTemplatePath())#">
 <cfcatch>
  <cfrethrow>
 </cfcatch>
</cftry>
<!--- \\ include.cfm // --->

Erki

----- Original Message -----
From: "Clint Tillerson" <[EMAIL PROTECTED]>
To: "Fusebox" <[EMAIL PROTECTED]>
Sent: Thursday, January 25, 2001 4:10 PM
Subject: Error Handling


> Is there a way, documented or otherwise to dynamically grab the
> name of an included template as it is processing.  cgi.script_name
> returns the "URL template" but in fusebox this is always
> "/path/index.cfm".
>
> I would like to grab the name of the included template that is
> processing when an error occurs.  I can't find a way to do this other
> than by brute force by setting a variable I call
> 'variables.thisTemplate' at the top of every template, then I have to
> reset it after each include.
>
> Any suggestions are greatly appreciated.
>
> clint



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to