![]() |
| ||
| Catching Attribute Validation Errors 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. |
| ||
| Re: Catching Attribute Validation Errors Quote:
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. Quote:
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 |
| ||
| Re: Catching Attribute Validation Errors More information can be found at: http://livedocs.adobe.com/coldfusion...e=00000242.htm Quote:
~ mellamokb |
| ||
| Re: Catching Attribute Validation Errors 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 |
| ||
| Re: Catching Attribute Validation Errors No problem. Glad to help! ~ mellamokb |
| All times are GMT -4. The time now is 1:24 am. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC