add some code to help avoid drracket dying when the sandbox does strange things

This commit is contained in:
Robby Findler 2012-05-14 07:53:52 -05:00
parent d2d82d325b
commit e4887f576d

View File

@ -105,7 +105,14 @@
(define (init-sandbox)
(unless sandbox
(when language-info
(set! sandbox (make-evaluator 'racket/base)))))
;; creating a sanbox can fail in strange ways so we just
;; swallow the failures so as to not wreck DrRacket
(with-handlers ((exn:fail? (λ (x)
(log-error (exn-message x))
(for ([x (in-list (continuation-mark-set->context
(exn-continuation-marks x)))])
(log-error (format " ~s" x))))))
(set! sandbox (make-evaluator 'racket/base))))))
(define/override (first-opened settings)
(define ns (with-handlers ((exn:fail? (lambda (x) #f)))