•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 427,194 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,147 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser: Programming Forums
Views: 1051 | Replies: 4 | Solved
![]() |
•
•
Join Date: Apr 2007
Posts: 28
Reputation:
Rep Power: 2
Solved Threads: 0
Hi,
I have a cferror type = "exception" exception="any" in my application.cfm file. This works great for most errors, but I recently found that it is not working for attribute validation errors.
For example, if I misspell an attribute for the cfqueryparam tag, my custom error page is not called. Instead, I get the default error that shows the SQL in my query, which I don't want. Cftry/cfcatch didn't work, either.
I can't use the Site-wide Error Handler, because I'm on a hosted server and I'm not allowed to make any changes to the Coldfusion Administrator.
Any ideas?
Thank you.
I have a cferror type = "exception" exception="any" in my application.cfm file. This works great for most errors, but I recently found that it is not working for attribute validation errors.
For example, if I misspell an attribute for the cfqueryparam tag, my custom error page is not called. Instead, I get the default error that shows the SQL in my query, which I don't want. Cftry/cfcatch didn't work, either.
I can't use the Site-wide Error Handler, because I'm on a hosted server and I'm not allowed to make any changes to the Coldfusion Administrator.
Any ideas?
Thank you.
•
•
Join Date: Jan 2008
Posts: 35
Reputation:
Rep Power: 1
Solved Threads: 5
•
•
•
•
Instead, I get the default error that shows the SQL in my query, which I don't want. Cftry/cfcatch didn't work, either.
There are two different types of errors that can occur in a webpage: parsing / compile-time errors and run-time errors. If you misspell an attribute in the query, then the cf engine can already determine that the query is not going to work, so it doesn't try to execute the query and then die with an exception that the attribute was misspelled. It checks that ahead of time when it is parsing / compiling the page.
•
•
•
•
This works great for most errors, but I recently found that it is not working for attribute validation errors.
You must fix those types of errors at compile-time, i.e., try to compile all of your web pages and see what errors arise. Or at least view all of your pages once first before you publish them for the whole world to see, and you can catch those errors, because the error will show up every time the page is viewed, not just sometimes, if the error is a compile-time error. A run-time error only shows up in the situation that causes the exception, and it makes sense to catch those errors gracefully.
~ mellamokb
•
•
Join Date: Jan 2008
Posts: 35
Reputation:
Rep Power: 1
Solved Threads: 5
More information can be found at:
http://livedocs.adobe.com/coldfusion...e=00000242.htm
~ mellamokb
http://livedocs.adobe.com/coldfusion...e=00000242.htm
•
•
•
•
DracTK said on Apr 12, 2007 at 9:11 AM :
What thekat is saying is that the CF template has to be compilable in order for errors that cferror can catch to occur. cferror is only for run time errors, doesn't work for compile time errors (which makes a lot of sense).
Runrocket said on Jul 9, 2007 at 8:12 AM :
What is interesting is that while CFERROR will not catch compile time errors like '<cfet x = 1 />', if you define a site wide error handler in CF Administrator, this error will get caught and the user will be redirected to your custom error template. The problem here is that this error template cannot be customized for a specific application, but will appear for all applications hosted on your stand alone server or JRun instance.
~ mellamokb
•
•
Join Date: Apr 2007
Posts: 28
Reputation:
Rep Power: 2
Solved Threads: 0
Thank you, mellamokb. That was helpful. I just wanted to make sure I was doing everything possible. I do always check before I publish a page, but I've inherited this site, and there are a lot of pages that I haven't worked on.
Thanks again!
-- Lafalot
Thanks again!
-- Lafalot
Last edited by lafalot : Jan 5th, 2008 at 1:58 am.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ColdFusion Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: C# or C++ with coldfusion web service
- Next Thread: report builder


Linear Mode