Loading ...
Sorry, an error occurred while loading the content.

Fusebox 5.5 XML Application.cfc onError()

Expand Messages
  • Jeffrey Roberson
    Trying to get site wide error handling to work with the XML and using Application.cfc I usually just use Application.cfm... but anyway. Is this correct? I want
    Message 1 of 2 , May 25, 2011
    • 0 Attachment
      Trying to get site wide error handling to work with the XML and using Application.cfc I usually just use Application.cfm... but anyway.


      Is this correct?

      I want to trap for general errors as well as the Fusebox ones:

      <!---
      if you define any onXxxYyy() handler methods, remember to start by calling
      super.onXxxYyy(argumentCollection=arguments)
      so that Fusebox's own methods are executed before yours
      --->

      <cffunction name="OnError" access="public" returntype="void" output="true" hint="Fires when an exception occures that is not caught by a try/catch.">

      <!--- Define arguments. --->
      <cfargument name="Exception" type="any" required="true" />
      <cfargument name="EventName" type="string" required="false" default="" />
      <cftry>
      <cfset super.OnError(argumentCollection=arguments) />
      <cfcatch type="any" >
      <!--- add code here to trap for stuff --->
      </cfcatch>
      </cftry>
      <cfreturn />
      </cffunction>

      Or should it be without calling the Fuxebox onError() Method:

      <!---
      if you define any onXxxYyy() handler methods, remember to start by calling
      super.onXxxYyy(argumentCollection=arguments)
      so that Fusebox's own methods are executed before yours
      --->


      <cffunction name="OnError" access="public" returntype="void" output="true" hint="Fires when an exception occures that is not caught by a try/catch.">
      <!--- Define arguments. --->
      <cfargument name="Exception" type="any" required="true" />
      <cfargument name="EventName" type="string" required="false" default="" />
       <!--- add code here to trap for stuff --->
      <cfreturn />
      </cffunction>

      It seems to work the first way, but seems to be a little weird.

      Thanks in advance for the help.

      Jeff 






    • Barney Boisvert
      After the in your onError method, you ll want to add whatever you want to happen when an error is occurred (CFMAIL a CFDUMP of the exception,
      Message 2 of 2 , May 25, 2011
      • 0 Attachment
        After the </cfcatch> in your onError method, you'll want to add whatever you want to happen when an error is occurred (CFMAIL a CFDUMP of the exception, CFLOCATION to a static error template, etc.)

        cheers,
        barneyb

        On Wed, May 25, 2011 at 2:07 PM, Jeffrey Roberson <jeff@...> wrote:


        Trying to get site wide error handling to work with the XML and using Application.cfc I usually just use Application.cfm... but anyway.


        Is this correct?

        I want to trap for general errors as well as the Fusebox ones:

        <!---
        if you define any onXxxYyy() handler methods, remember to start by calling
        super.onXxxYyy(argumentCollection=arguments)
        so that Fusebox's own methods are executed before yours
        --->

        <cffunction name="OnError" access="public" returntype="void" output="true" hint="Fires when an exception occures that is not caught by a try/catch.">

        <!--- Define arguments. --->
        <cfargument name="Exception" type="any" required="true" />
        <cfargument name="EventName" type="string" required="false" default="" />
        <cftry>
        <cfset super.OnError(argumentCollection=arguments) />
        <cfcatch type="any" >
        <!--- add code here to trap for stuff --->
        </cfcatch>
        </cftry>
        <cfreturn />
        </cffunction>

        Or should it be without calling the Fuxebox onError() Method:

        <!---
        if you define any onXxxYyy() handler methods, remember to start by calling
        super.onXxxYyy(argumentCollection=arguments)
        so that Fusebox's own methods are executed before yours
        --->


        <cffunction name="OnError" access="public" returntype="void" output="true" hint="Fires when an exception occures that is not caught by a try/catch.">
        <!--- Define arguments. --->
        <cfargument name="Exception" type="any" required="true" />
        <cfargument name="EventName" type="string" required="false" default="" />
         <!--- add code here to trap for stuff --->
        <cfreturn />
        </cffunction>

        It seems to work the first way, but seems to be a little weird.

        Thanks in advance for the help.

        Jeff 











        --
        Barney Boisvert
        bboisvert@...
        http://www.barneyb.com/
      Your message has been successfully submitted and would be delivered to recipients shortly.