Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的coldfusion Application.cfc 文件中,我定义了一个onError 函数。在某些情况下,我使用 cfthrow 标记显式抛出异常 - 例如<cfthrow object="#myException#">. 我的问题是,为什么这不会创建一个无限循环?或者至少引起对 onError 函数的另一个调用?(相反,它只是将错误转储到屏幕上。实际上,这是我想要的功能:) - 但我仍然对为什么会发生这种情况感到困惑。)
<cfthrow object="#myException#">
这是预期和记录的行为:
如果在处理 onError 方法时发生异常,或者如果 onError 方法使用 cfthrow 标记,则 ColdFusion 标准错误处理机制会处理该异常。