Is there any way to catch all unhandled exceptions, even exceptions raise in distinct TThread
? The idea is to write these exceptions into a log file.
NOTE: Solution must work under iOs/Android ...
Is there any way to catch all unhandled exceptions, even exceptions raise in distinct TThread
? The idea is to write these exceptions into a log file.
NOTE: Solution must work under iOs/Android ...
As per the comments, rustling up some code is going to get you nowhere fast, so the smart money heads towards getting a product to the job for you.
In the interests of fairness I won't point you at my favourite but mention the popular products I have encountered:
And then there are Open Source options:
You can also hook exceptions using RtlUnwindProc
as demonstrated for Win32 in this SO answer.
However, the primary drawback with all these options, as far as I know, is they only target Windows platforms. If you are targeting mobile (Android, iOS) or Macintosh then you'll unfortunately have to roll up your sleeves and ensure you put handlers into every thread you create and get familiar with Application.OnException
, TThread.FatalException
, et al.
** I haven't personally used these product so don't know if they pick up exceptions in all threads, but currently assume they do