GUI package manager: catch and report errors

This commit is contained in:
Matthew Flatt 2013-08-11 07:10:38 -06:00
parent 7c95c5ad38
commit a8250641e0

View File

@ -288,7 +288,15 @@
(set! task (thread
(lambda ()
(with-handlers ([exn:break? void])
(thunk)
(with-handlers ([exn:fail? (lambda (exn)
(queue-callback
(lambda ()
(message-box
"Error"
(exn-message exn)
(get-top-level-window)
'(ok stop)))))])
(thunk))
(let ([f finalize])
(queue-callback/wait (lambda () (f #t)))))))))