InnerException never set when using madExcept

delphi package - automated exception handling
Post Reply
Stefan Glienke
Posts: 1
Joined: Tue Dec 08, 2015 1:32 pm

InnerException never set when using madExcept

Post by Stefan Glienke »

When using madExcept the InnerException property of exceptions is never set because the HookExceptionRaisingException procedure does not
what Exception.RaisingException does (calling SetInnerException which calls AcquireExceptionObject setting the result to its FInnerException field).

In fact there is some commented out code in HookExceptionRaisingException that indicates that it has been there but for some reason was removed.

I added the following lines after the

Code: Select all

if Self.InstanceSize >= 28 then begin 
and in a simple test it still works and now exceptions have their InnerException property properly set.

Code: Select all

if Self.AcquireInnerException and (TObject(ExceptObject) is ExceptionClass) then
  Self.InnerException := AcquireExceptionObject;
Was there some reason to not do this and break this RTL functionality when using madExcept?
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: InnerException never set when using madExcept

Post by madshi »

This is basically the same thing as this:

viewtopic.php?f=4&t=28115
Post Reply