Articles - New Filter Exceptions expert in GExperts | BESK.SU - программирование без границ (c) 2025

Articles New Filter Exceptions expert in GExperts

FireWind

Завсегдатай
Moderator
Credits
586
New Filter Exceptions expert in GExperts
2020-07-13 by dummzeuch
[SHOWTOGROUPS=4,20]
I my last GExperts related Как увидеть ссылки? | How to see hidden links? I wrote about the new “Close Exception Notification” expert which I just had added to GExperts. It was a hack that hooked the Exception Notification dialog.

This spawned a Как увидеть ссылки? | How to see hidden links? in the international Как увидеть ссылки? | How to see hidden links? and resulted in a rewrite of the expert. It’s now called “Filter Exception” expert and instead of hooking the dialog it directly hooks into the code that shows this dialog. Thus it prevents the dialog from being shown for filtered exceptions.

I have to thank Как увидеть ссылки? | How to see hidden links? of Как увидеть ссылки? | How to see hidden links? fame for the detective work that lead to to this hooking code.

In that same discussion Как увидеть ссылки? | How to see hidden links? suggested to add a project scope to the filtering. I have implemented that too.

So now the expert can filter on:
  • Project name, which is a regular expression.
  • Exception class
  • Exception message, which again is a regular expression
I have added all those exceptions that the Delphi IDE raises on every startup to my filter. It filters on the Project = “GExperts.*”, the exception classes and the messages it shows.

Как увидеть ссылки? | How to see hidden links?

That means it will no longer annoy me with them while I am debugging GExperts but will still show them for other projects.

The filter details look like this:

Как увидеть ссылки? | How to see hidden links?

Как увидеть ссылки? | How to see hidden links?

It’s also possible to add a filter for the current debug session only, which means that it will be deleted automatically once the debug session ends.

Unfortunately hooking of the code is only available for Delphi 2005 and later. Older versions still have got to hook the Exception Notification dialog.

If you want to test this new functionality, you’ll have to Как увидеть ссылки? | How to see hidden links?. Try it, it’s not rocket science!
[/SHOWTOGROUPS]
 
Сверху