Why don't I get a recursive infinite loop when throwing an error in the onError function?

无人久伴 提交于 2019-12-11 14:26:50

问题


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.



来源:https://stackoverflow.com/questions/7544623/why-dont-i-get-a-recursive-infinite-loop-when-throwing-an-error-in-the-onerror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!