PROBLEM

There is a problem with CodeSite's method-tracing system that initially might not be very obvious.

The problem is when an exception occurs in a method, ExitMethod is not called.  At first, this may seem like desirable behavior - until the code has traced methods to several levels deep.  Then, it can become difficult to determine where the exception actually occurred without a lot of work in Delphi's debugger.  CodeSite supports sending error messages but more code is needed to make it work right within the context of a specific method-trace:

       procedure MyProc;
       begin
         CodeSite.EnterMethod('MyProc');
         try
           try
             { MyProc body goes here... }
           except
             on E: Exception do
               CodeSite.SendError(E.Message);
           end;
         finally
           CodeSite.ExitMethod('MyProc');
         end;
       end;

This can get very cumbersome!