Delphi Exception handling problem with multiple Exception handling blocks

半腔热情 提交于 2019-12-05 05:18:06

If I am right, the behaviour you are seeing is witnessed when evaluating E under the debugger (this I obtained similar behaviour testing this in the BDS 2006 debugger).

This is a symbol resolution bug in the debugger but does not appear to affect runtime behaviour.

If debugging behaviour is important, simply rename your exception handler variables so that the debugger does not have any (potential) ambiguities to have to resolve:

On E1: E1 do
begin
    OutputDebugString('E1');
end;

On E2: E2 do
begin
    OutputDebugString('E2');
end;

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