Skip to main content
Inspiring
June 4, 2009
Answered

Site-Wide Error Handler Filepath

  • June 4, 2009
  • 1 reply
  • 4669 views

My error handler page is located at C:\Inetpub\wwwroot\portal\error_handler.cfm but cfadmin (for CF 😎 wants a relative path.  I've tried:

C:\Inetpub\wwwroot\portal\error_handler.cfm

Inetpub\wwwroot\portal\error_handler.cfm

wwwroot\portal\error_handler.cfm

portal\error_handler.cfm

error_handler.cfm

and http://www.hostname.com/portal/error_handler.cfm

Each time is says the specified file does not exist.

What should the filepath be relative to?

Thanks!

This topic has been closed for replies.
Correct answer ilssac

It has to be relative to a ColdFusion mapping OR the ColdFusion web root.  The latter has always been the most reliable for me.

It is a little known feature of ColdFusion that it often has two web roots for which it will search for cfml templates.  The web root defined for the web server such as c:\inetpub\wwwroot\ that you apparently have.  But before searching the web server web root it will search the ColdFusion web root, that on my multi-home flavor of ColdFusion is c:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\.  It is this latter directory that I put my site wide error and missing template handler fiels.  Then I just place the file names in the appropiate fields in the administrator.

If you have a default backslash (\) mapping to your web root defined in the ColdFusion administrator, you should be able to input something like "\portal\error_handler.cfm" but I have always had difficulty getting this way to work.

1 reply

ilssac
ilssacCorrect answer
Inspiring
June 4, 2009

It has to be relative to a ColdFusion mapping OR the ColdFusion web root.  The latter has always been the most reliable for me.

It is a little known feature of ColdFusion that it often has two web roots for which it will search for cfml templates.  The web root defined for the web server such as c:\inetpub\wwwroot\ that you apparently have.  But before searching the web server web root it will search the ColdFusion web root, that on my multi-home flavor of ColdFusion is c:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\.  It is this latter directory that I put my site wide error and missing template handler fiels.  Then I just place the file names in the appropiate fields in the administrator.

If you have a default backslash (\) mapping to your web root defined in the ColdFusion administrator, you should be able to input something like "\portal\error_handler.cfm" but I have always had difficulty getting this way to work.

kodemonkiAuthor
Inspiring
June 4, 2009

\portal\error_handler.cfm worked perfectly!  So I created an error and loaded the page and what did I see?  The error . . .

Do I need to put something like <cferror type="exception" template="error_handler.cfm" exception="any"> in Application.cfc?  It was supposed to display a page just saying the admin has been notified and send me an email with all the error variables.

ilssac
Inspiring
June 4, 2009

No <cferror...> is a different exception handling feature of ColdFusion that is seperate from the site wide error handler feature.

What was the error and more importantly where was the error?  Make sure it is not the error handler code itself that is throwing this exception as it can't catch errors from itself.