3 ms·
Wrap something like this around a main startup function for your application: (handler-case (main-user-function) (error (c) (princ "a serious
by lispm 17y ago
Wrap something like this around a main startup function for your application:
(handler-case (main-user-function)
(error (c)
(princ "a serious error, I'm quitting")
(quit))
(condition (c)
(princ "we have a problem")
(when (y-or-n-p "abort?")
(abort))))
It handles conditions of class ERROR in the first clause and conditions of class condition (all kinds of stuff that one can signal) in the second clause. The variable 'c' would be the condition object. You could inspect it and print more useful help, show dialogs, look for restarts and more.