Show
Ignore:
Timestamp:
11/03/06 21:47:29 (2 years ago)
Author:
scorfield
Message:

Fixes #140 by passing attributes and myFusebox to the handler.
Also renamed all of the local variables to be less likely to clash with any user-defined variables.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • framework/trunk/fuseboxApplication.cfc

    r229 r255  
    506506                <cfargument name="cfcatch" type="any" required="true"  
    507507                                        hint="I am the original cfcatch structure from the exception that fusebox5.cfm caught." /> 
    508                  
    509                 <cfset var handled = false /> 
    510                 <cfset var type = cfcatch.type /> 
    511                 <cfset var ext = "." & this.scriptFileDelimiter /> 
    512                 <cfset var errorFile = this.errortemplatesPath & type & ext /> 
    513                 <cfset var handlerExists = fileExists(getApplicationRoot() & errorFile) /> 
     508                <cfargument name="attributes" type="struct" required="true"  
     509                                        hint="I am the attributes 'scope'." /> 
     510                <cfargument name="myFusebox" type="any" required="true"  
     511                                        hint="I am the myFusebox object." /> 
     512                 
     513                <cfset var __handled = false /> 
     514                <cfset var __type = arguments.cfcatch.type /> 
     515                <cfset var __ext = "." & this.scriptFileDelimiter /> 
     516                <cfset var __errorFile = this.errortemplatesPath & __type & __ext /> 
     517                <cfset var __handlerExists = fileExists(getApplicationRoot() & __errorFile) /> 
    514518                <cfset var FUSEBOX_APPLICATION_KEY = variables.appKey /> 
    515519                 
    516                 <cfloop condition="not handlerExists and len(type) gt 0"> 
    517                         <cfset type = listDeleteAt(type,listLen(type,"."),".") /> 
    518                         <cfset errorFile = this.errortemplatesPath & type & ext /> 
    519                         <cfset handlerExists = fileExists(getApplicationRoot() & errorFile) /> 
    520                 </cfloop> 
    521                 <cfif handlerExists> 
    522                         <cfinclude template="#getCoreToAppRootPath()##errorFile#" /> 
    523                         <cfset handled = true /> 
    524                 </cfif> 
    525                  
    526                 <cfreturn handled /> 
     520                <cfloop condition="not __handlerExists and len(__type) gt 0"> 
     521                        <cfset __type = listDeleteAt(__type,listLen(__type,"."),".") /> 
     522                        <cfset __errorFile = this.errortemplatesPath & __type & __ext /> 
     523                        <cfset __handlerExists = fileExists(getApplicationRoot() & __errorFile) /> 
     524                </cfloop> 
     525                <cfif __handlerExists> 
     526                        <cfinclude template="#getCoreToAppRootPath()##__errorFile#" /> 
     527                        <cfset __handled = true /> 
     528                </cfif> 
     529                 
     530                <cfreturn __handled /> 
    527531                 
    528532        </cffunction>