In my coldfusion Application.cfc file, I define an onError function. In certain situations, I explicitly throw an exception using a cfthrow tag - e.g. <cfthrow object="#myException#">
. My question is, why doesn't this create an infinite loop? Or at least cause another call to the onError function? (Instead, it just dumps the error to the screen. Which is the functionality I want, actually :) - but I'm still confused about why this happens.)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This is expected and documented behavior:
If an exception occurs while processing the onError method, or if the onError method uses a cfthrow tag, the ColdFusion standard error handling mechanisms handle the exception.