Discussions related to Visual Prolog
daveplummermd
VIP Member
Posts: 80
Joined: 18 Jul 2006 17:18

STOPIT! Exception in VPI user error hander (vpi::setErrorHandler)

Unread post by daveplummermd »

Guys

I hav ea project that routinly terminates with a dialog:

Title: Exception in VPI user error hander (vpi::setErrorHandler)

Internal : "Dump could not be formatted


besides finally finding the bug, can I get this message to stop appearing?
I know it sounds messy, but I want it to stop even before I have time to dig deep into cause...

thanks in advance

dave plummer
Dave Plummer
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

This is what happens:
  • Some kind of exception occurs
  • You do not catch the exception, instead it is handled by vpi's the default exception handler.
  • The default exception handler invokes errorPresentationDialog::present on the exception
  • But that also raises an exception (most likely because the exception itself is "sick").
You can avoid the message if you set another vpi exception handler (by calling vpi::setErrorHandler with your substitute), i.e. if you set one that doesn't raise an exception. Without much loss it could look like this:

Code: Select all

predicates     robustErrorHandler : vpiDomains::errhandler. clauses     robustErrorHandler(_Window, TraceId) :-         try             errorPresentationDialog::present(TraceId)         catch _ do             succeed         end try.
Regards Thomas Linder Puls
PDC
Post Reply