protect against errors while loading color schemes

closes PR 14884
This commit is contained in:
Robby Findler 2014-12-13 14:37:18 -06:00
parent 9551380791
commit c494bf367e

View File

@ -630,7 +630,19 @@
(sort (set->list known-style-names) symbol<?))
(define preferred-color-scheme (preferences:get 'framework:color-scheme))
(for ([dir (in-list (find-relevant-directories '(framework:color-schemes)))])
(define info (get-info/full dir))
(define info (with-handlers ([exn:fail?
(λ (x)
(define sp (open-input-string))
(parameterize ([current-error-port sp])
((error-display-handler)
(if (exn? x) (exn-message x) (format "uncaught exn: ~s" x))
x))
(log-color-scheme-warning
"info file in ~a failed to load:\n~a"
dir
(get-output-string sp))
#f)])
(get-info/full dir)))
(when info
(define cs-info (info 'framework:color-schemes))
(cond