The TThread class offers the programmer a collection of various properties and methods. In this section, I'll take you through the most useful ones.
The FatalException property deals with exceptions. If an exception arises inside your Execute method and is not caught, it will be handled inside the system code:
if not Thread.Terminated thentry Thread.Execute;except Thread.FFatalException := AcquireExceptionObject;end;
The best place to check whether this property is assigned is the OnTerminate handler. If the FatalException is not nil, we can log the exception and call ReleaseExceptionObject to destroy the exception object or we can reraise the exception. The following code from the Threads demo shows how to implement such ...