Exception handlers execution order

delphi package - automated exception handling
Post Reply
Jerome Bouvattier
Posts: 3
Joined: Tue Sep 21, 2004 7:04 pm

Exception handlers execution order

Post by Jerome Bouvattier »

Hello,

I have several registered exception handlers. Although for most of them, I don't care in which order they will be executed, there is one I'd like to be executed last in any condition.

Can I ensure that ?

Best regards.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

The handlers are called in the same order in which you register them.
Jerome Bouvattier
Posts: 3
Joined: Tue Sep 21, 2004 7:04 pm

Post by Jerome Bouvattier »

Mathias,

That's what I found looking at the source. Still, you might want to consider this as a future feature. Full indexing might not be necessary, but flagging *one* handler to be executed last would be useful.

Here is my situation. I have a number of exception filters that set "handled" to true. And if an exception passed thru all registered filters, I want the *last* handler to tweak the report by adding additional information and sending it to my logging mechanism before letting madexcept doing its job (Show exception box, etc...)

Currently, my only chance is to put everything in a single handler (to ensure the execution order) as drawing on the registration order is too uncertain. On top of that, my first registered handler would probably be the one I want to be executed last.

Regards.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

I'll see what I can do. I have an idea how to realize this, but I can't say into which version I'll integrate it.
Jerome Bouvattier
Posts: 3
Joined: Tue Sep 21, 2004 7:04 pm

Post by Jerome Bouvattier »

Great !
Post Reply