Skip to main content
July 2, 2009
Question

Site-Wide Error Handler

  • July 2, 2009
  • 2 replies
  • 3834 views

I am trying to configure a site-wider error handler and it doesn't seem to work.. The template is created under one of my sites, i am pointing to it in the CF admin, but it keeps saying this error: "The file specified as the site wide error handler does not exist.                     The default error handler will be used until a replacement is created."

I have checked it and made sure the file is there and it keeps saying it doesn't exist. Has anyone else ran into this issue?

    This topic has been closed for replies.

    2 replies

    ilssac
    Inspiring
    July 2, 2009

    This is a common problem because many do not realize the ColdFusion may not be looking at the same "site root" as the web server.  In a basic configuration, it might, but often ColdFusion is working with two or more web sites, each with their own site root and it can not show prefference to one or the other.

    YOU can tell it to give preference to a specific site root by defining a mapping to the backslash ("/") character.  Or you can put your site wide handler in ColdFusion's site root.  Where that is depends on which flavor of CF you have configured, stand-alone, multi-home or J2EE.

    On my multi-home version it  is "C:/JRun4/servers/cfusion/cfusion-ear/cfusion-war/"

    July 3, 2009

    Wow, thank you that was exactly what i needed. One more question though, how could i get it to email me with the error information everytime that page gets loaded? Is this possible?

    ilssac
    Inspiring
    July 3, 2009

    Sure it is possible.  The sitewide error template can run any, or all, CFML code.  You can easily have it include a <cfmail...> tag that mails you all the gory details about the exception that was just thrown.

    tclaremont
    Inspiring
    July 2, 2009

    Check the file permissions on the error handler file. Also, keep in mind that the permissions need to be relevent to the username used to RUN the ColdFusion server. To test this, but not recommended for production use, give everyone full access to the error handler file long enough to test the page. If that works, apply your premissions very selectively to that file.