From: Bruce Tobin

Subject: Re: error-handling

Date: 1996-12-19 20:34



On Thu, 19 Dec 1996, Donald H. Mitchell wrote:

> Bruce Tobin wrote:
> > > > Is there a way to install a customized global error handler in Allegro/Win? > > Something portable would be nice, but anything that works would be > > appreciated.
> > I may not fully appreciate your question, but the condition system works > under ACL 3.0 and following systems. If you don't understand the > condition system, I may be able to help you.
I have a very basic understanding of the condition system, e.g. how to use (ignore-errors) and (handler-case). These constructions seem not to have been designed with event-driven GUI applications in mind, and I can't find anything in CLTL2 that does seem to be so designed.
> If you don't understand > how to establish your own top-level loop w/ condition handling, I can > give you example code.
Thanks. Here's the kind of thing I want to be able to handle. Suppose I design a dialog with one button, whose set-value-fn is (defun button-1-set-value-fn (x y z) (error "Oops! Wrong button!")) Now I want to be able to run this dialog, trapping this and any other errors that may be generated by functions called from the dialog's event loop. I tried (ignore-errors (dialog-1)) but this of course did not trap the error. Obviously I don't want to have to put error-trapping code at the beginning of every event-handling function, but what is my alternative?