Problem:
I have old code, which is working fine with previous version of EurekaLog (5.x/6.x). It does not work with EurekaLog 7. I set all options as outlined in guides, but EurekaLog is not invoked automatically for exceptions. My code assigns Application.OnException handler.
Reason:
Previous EurekaLog versions ignored whenever Application.OnException event was set or not. This behavious conflicted with default behaviour of Application object.
EurekaLog 7 changes the way to work with Application.OnException event. EurekaLog 7 respects this event: if event handler is NOT set - then EurekaLog will handle exceptions automatically; if event handler is set - then EurekaLog assumes that you want to handle exceptions by yourself.
Solution:
That depends on what you want.
- If you want EurekaLog to handle exception - you don't need Application.OnException handler. Just remove it:
- You can use {$IFDEF EUREKALOG} or EBase.IsEurekaLogActive to determinate if you need to install Application.OnException or not. You can install your own handler for Application.OnException when you compile application without EurekaLog.
- You can move your code to OnExceptionNotify handler.
- If you want to run your custom code for each exception - then you can keep your handler:
- You can call EExceptionManager.ExceptionManager.ShowLastExceptionData inside your Application.OnException handler to invoke EurekaLog's processing for current exception.
- You can move your code to OnExceptionNotify handler and use
AHandleargument to switch between EurekaLog's processing and your code.
See also: