Does anyone have a quick sample they could show on how to change some of the global settings for MadExcept.
I have reviewed the link, but unfort I'm not getting it.
I want to do 2 things:
1. Change email subject to add registered client name.
2. Add additional attachment to the email (config.ini).
I see these statements:
MESettings.AdditionalAttachments.Add('c:\boot.ini');
property IMESettings.MailSubject : string; // mail subject
I have extensive error handling in the app, just trying to use Mad to catch everything else and email it to me.
Thanks.
Sample Code
Re: Sample Code
You can change settings either globally (for all exceptions) or "locally" (for just the current exception). If you want to change things globally, add "madExcept" to your uses clause, then you can use the function "MESettings()" which will return an IMESettings interface representing all the global properties you can change, like "AdditionalAttachments", "MailSubject" etc. If you want to change things locally, you need to register an exception callback by using RegisterExceptionHandler, and your callback will then get a parameter "exceptIntf: IMEException" which inherits from IMESettings. You can change all the same settings through that interface, too, local to the current exception.
Hope that helps?
Hope that helps?
-
- Posts: 4
- Joined: Mon Jun 20, 2016 7:18 am
Re: Sample Code
Hi. I'm trying to do something similar, I want to change the setting globally. Do i need to add "MadExcept" to the uses clause in every unit in my project ?
Re: Sample Code
No, just in those units where you want to access madExcept APIs.
-
- Posts: 4
- Joined: Mon Jun 20, 2016 7:18 am
Re: Sample Code
Thank you for the prompt reply. Works perfectly !