> is the onerror event called when ANY error 
> occurs? i have read that it is for all exception 
> errors, and other types of errors that occur are 
> missing template, and server side form 
> validation.

What you've read is correct, except that missing template errors with CFINCLUDE 
are also runtime exceptions, and thus they're also caught by onerror. The 
onerror event handler only catches runtime exceptions. If you want to catch 
compiler errors, you can use the CFERROR tag or the site-wide error handler. If 
you want to catch validation errors, use CFERROR.

> i tried to force an error simply by missing out the
> cfform tag of a form, it produced an error but 
> didnt enter the onerror tag.

That's not a runtime exception, it's a compiler error.  It won't be caught by 
onerror. Generally, this sort of error isn't a real problem in a production 
site, because you discover the error when you first browse the page as you 
write it. Compiler errors happen before the page actually runs, and if you have 
one, it prevents the page from running under any circumstances. Runtime 
exceptions, on the other hand, typically only occur when you have logical 
errors in code that compiles successfully.

> basically i want to be sent an email each time 
> ANY error occurs so some advice on whether 
> this is done solely within the onerror method 
> would be great and also do i need to do this 
> anywhere else to catch some of the silly error 
> like i mentioned above

Again, it's unlikely that the silly error you mentioned above is something you 
have to worry about. The onerror event handler is sufficient to catch runtime 
exceptions, which (other than validation errors) are all you should have in 
production sites.

> whats the best way to also handle missing 
> templates when my web host doesn't allow 
> me access to the coldfusion administrator?

If you're referring to missing templates with CFINCLUDE, the onerror event 
handler will catch that. If you're talking about catching 404 errors, there are 
a variety of ways to deal with that, but most depend on configuring your web 
server, I think.

Dave Watts, CTO, Fig Leaf Software 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:293699
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to