Home GrapeVine Voice: Unhandled Exceptions Revisited, Part I

GrapeVine Voice: Unhandled Exceptions Revisited, Part I

I have used Mauro’s library to handle unhandled exceptions for years. However, lately I decided to improve my usage and added some advanced features such as sending exception logs to my mail box so that I can collect and analyse them.


According to Mauro’s source code, this should be done by using TExceptionManager.AddInfoManagerType. However, I find a bug there in version 2.3, so I have to modify the source code myself and create a customized 2.3.1 version.


For 2.3.1 version, if you want to change the default exception dialogue, please create a form that implements IExceptionInfoManager. Then you can set TExceptionManager.DefaultInfoManagerType to type of your form. In my case, the source code is,

TExceptionManager.DefaultInfoManagerType = typeof(UnhandledExDlgForm);
TExceptionManager.UserContinue = true;

An interesting discovery is that Delphi for .NET compiler automatically merges Borland.Delphi.dll into my modified UnhandledExceptionManager.dll. So ILMerge is not needed here.

Also I find a issue that signing a Delphi for .NET assembly is so hard. First, IDE cannot generate a key file for you. Second, signing the debug version does not mean the release version is signed automatically for you. OMG, it seems that using Delphi for .NET is quite inconvenient.

This post is licensed under CC BY 4.0 by the author.

GrapeVine Voice: Issue 4 Revisited

GrapeVine Voice: Unhandled Exceptions Revisited, Part II

Comments powered by Disqus.