Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: getting error message - onError undefined - even though onError is handling the error

$
0
0

Just a remark next to what Carl has said. The methods of Application.cfc start with the prefix 'on', meaning, 'upon'. That is to say, the methods are event handlers. For example, onError runs upon an error occurring. That is designed to happen automatically, without your intervention.

 

However, nothing stops you from calling any of Application.cfc's event handlers manually. Suppose you attempt to call onError from a CFM page. Then that will mean first creating an Application component object to call it on. At this point you will find yourself having to create an instance of Application.cfc. My guess is, you had an error because you failed to create that object.

 

But then comes the question: why muck about creating an instance of Application.cfc in a CFM page, when the CFC is designed to run as an include that precedes the page? In other words, instantiating Application.cfc defeats the very purpose of its design.


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>