Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MadExcept exception filter

I am using Delphi XE2 and Mad Except i have an application witch uses Indy for some internet operations ... the problem is that when an simple exception is raised like there is no internet connection madexcept pops up. I want to disable these exceptions witch are coming from indy.

I have the following exception class : EIdSocketError message : Socket Error #11004

I entered in the exception filter dialog in mad except and put EIdSocketError at exception filter but it doesn't work what am i doing wrong ?

enter image description here

like image 581
opc0de Avatar asked Jul 16 '26 18:07

opc0de


2 Answers

The name of the class being raised is EIdSocketError but you set the filter to EIDSocketError instead. Perhaps MadExcept is case sensitive? Also keep in mind that all Indy exceptions are ultimately derived from EIdException so you might want to filter for that instead.

In any case, MadExcept only catches uncaught exceptions, so using try/except blocks in your code is the correct solution. That is how Indy is designed to be used. If you are getting exceptions when the components are being instantiated at runtime during DFM streaming, then you must have left the components in an Active state at design-time. Do not do that. Make sure the components are deactivated at designtime, then activate them in your code at runtime when you are ready to use them.

like image 109
Remy Lebeau Avatar answered Jul 20 '26 11:07

Remy Lebeau


madExcept will only catch those exceptions that are not handled by your application itself. So a simple try-except block that handles the exceptions in question might be the cleanest solution to your problem.

like image 34
Uwe Raabe Avatar answered Jul 20 '26 11:07

Uwe Raabe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!