Dynamically check if exception in exception filters
-
- Posts: 10
- Joined: Fri May 20, 2011 2:56 pm
Dynamically check if exception in exception filters
Hi ...
Is there a way for me to check if given exception that was raised is in the exception filters in the settings window ?
Is there a way for me to check if given exception that was raised is in the exception filters in the settings window ?
Re: Dynamically check if exception in exception filters
You can use "exceptIntf.Filter1Classes" or "Filter2Classes" to ask the list of classes in the settings window. And you can use "exceptIntf.ExceptClass" to get the class name of the current exception. With all that information, you can simply check if the current exception class is listed in either Filter1Classes or Filter2Classes.
-
- Posts: 10
- Joined: Fri May 20, 2011 2:56 pm
Re: Dynamically check if exception in exception filters
Hi ...
I see the exceptIntf.ExceptClass property but not exceptIntf.Filter1Class or exceptIntf.Filter2Class, are they private ?
I see the exceptIntf.ExceptClass property but not exceptIntf.Filter1Class or exceptIntf.Filter2Class, are they private ?
Re: Dynamically check if exception in exception filters
Does the compiler complain?
-
- Posts: 10
- Joined: Fri May 20, 2011 2:56 pm
Re: Dynamically check if exception in exception filters
exceptIntf.Filter2Classes;
[dcc32 Error] main.pas(795): E2003 Undeclared identifier: 'Filter2Classes
Yes he does
[dcc32 Error] main.pas(795): E2003 Undeclared identifier: 'Filter2Classes
Yes he does
Re: Dynamically check if exception in exception filters
Hmmmm, ok, then try using "MESettings().Filter2Classes" instead of "exceptIntf.Filter2Classes".
-
- Posts: 10
- Joined: Fri May 20, 2011 2:56 pm
Re: Dynamically check if exception in exception filters
Just to be sure that I'm not telling you some bullshit, I'll try to explain my situation again.
I'm inside the OnException event on TMadExceptionHandler.
In my case :
{code}
procedure TfrmMain.adalException(const exceptIntf: IMEException;
var handled: Boolean);
{code}
Here I want to check if the exceptIntf.ExceptClass is in either ExceptionFilter1 og ExceptionFilter2.
Properties Filter1Classes and Filter2Classes are not visible on variable exceptIntf.
Your suggestion to try MESettings() I don't understand, there's no property on the exceptIntf, so I'm not sure what you're telling me
Could you please clarify this for me
Thanks for quick responses and good service ...
I'm inside the OnException event on TMadExceptionHandler.
In my case :
{code}
procedure TfrmMain.adalException(const exceptIntf: IMEException;
var handled: Boolean);
{code}
Here I want to check if the exceptIntf.ExceptClass is in either ExceptionFilter1 og ExceptionFilter2.
Properties Filter1Classes and Filter2Classes are not visible on variable exceptIntf.
Your suggestion to try MESettings() I don't understand, there's no property on the exceptIntf, so I'm not sure what you're telling me
Could you please clarify this for me
Thanks for quick responses and good service ...
Re: Dynamically check if exception in exception filters
I'm not sure I understand what you're asking. "MESettings().Filter2Classes" works fine for me. So what's the problem?
-
- Posts: 10
- Joined: Fri May 20, 2011 2:56 pm
Re: Dynamically check if exception in exception filters
In what scope is MESettings() a valid variable ?
[dcc32 Error] main.pas(795): E2003 Undeclared identifier: 'MESettings'
[dcc32 Error] main.pas(795): E2003 Undeclared identifier: 'MESettings'
Re: Dynamically check if exception in exception filters
It's a function exported by madExcept.pas.
-
- Posts: 10
- Joined: Fri May 20, 2011 2:56 pm
Re: Dynamically check if exception in exception filters
Now we are talking ..., that's what was missing, add madExecpt.pas to my uses clause ( I thought that madExceptVcl.pas was enough).
Thank you for your support