log errors that read-language produces when DrRacket calls it

This commit is contained in:
Robby Findler 2012-06-22 10:30:36 -05:00
parent af73e6f274
commit 3250d97f71
2 changed files with 9 additions and 1 deletions

View File

@ -155,7 +155,12 @@
;; info-result : (or/c #f [#lang without a known language]
;; (vector <get-info-proc>) [no #lang line, so we use the '#lang racket' info proc]
;; <get-info-proc> [the get-info proc for the program in the definitions]
[info-result (with-handlers ((exn:fail? (λ (x) #f)))
[info-result (with-handlers ((exn:fail?
(λ (x)
(log-debug (format "DrRacket: error duing call to read-language for ~a:\n ~a"
(or (send this get-filename) "<<unsaved file>>")
(regexp-replace* #rx"\n(.)" (exn-message x) "\n\\1 ")))
#f)))
(read-language
port
(lambda ()

View File

@ -273,6 +273,9 @@ as the @racket[_key] argument to the @racket[_get-info] function to do so:
@item{@language-info-ref[drracket:opt-out-toolbar-buttons]}
@item{@language-info-ref[color-lexer]}]
If the call to @racket[read-language] raises an error, DrRacket logs the
error via @racket[log-debug].
@language-info-def[color-lexer]{
When a language's @racket[_get-info] procedure responds to @racket['color-lexer], it
is expected to return a procedure suitable to pass as the @racket[_get-token]