Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Error Handling - displaying Error on ALL error events

Enthusiast ,
Nov 21, 2011 Nov 21, 2011

I am trying to set up a global error handling page error.cfm so that whenever any error at all occurs I can display my error.cfm page.

At first I tried the following in the application.cfm page, and then ran a page that tried to output a variable that did not exist, and it seemed to work:

<cferror type = "EXCEPTION" exception = "any" template = "error.cfm">

But then it just decided not to work, so I added these

<cferror type = "REQUEST" template = "error.cfm">

<cferror type = "VALIDATION" template = "error.cfm">

Is there a way to make sure that all errors are handled? Am I right in putting all 3 of these in the application.cfm or do I need more (or less?)

Thanks

Mark

TOPICS
Advanced techniques
557
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 21, 2011 Nov 21, 2011

Could you be more specific on "then if decided not to work"?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 21, 2011 Nov 21, 2011
LATEST

It just didn't react to the error, by going to error.cfm, it just threw out the usual CF error as if I had not added CFERROR

With those 3 statements in there is seems to work, but I wanted to make sure that no matter what error occurs it's going to hit the error.cfm

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources