original commit: 5ecd62e6f24c56f3282c99f7da730bd2fdb1c440
This commit is contained in:
Matthew Flatt 2004-03-15 23:22:35 +00:00
parent fb5f0c2d47
commit ad499c8c88
8 changed files with 17 additions and 19 deletions

View File

@ -115,7 +115,7 @@
(define (main)
(when (file-exists? autosave-toc-filename)
;; Load table from file, and check that the file was not corrupted
(let* ([table (let ([v (with-handlers ([not-break-exn? (lambda (x) null)])
(let* ([table (let ([v (with-handlers ([exn:fail? (lambda (x) null)])
(call-with-input-file autosave-toc-filename read))]
[path? (lambda (x)
(and (string? x)
@ -252,7 +252,7 @@
(string-constant cancel)
(string-constant warning)
#f)
(with-handlers ([not-break-exn?
(with-handlers ([exn:fail?
(lambda (exn)
(message-box
(string-constant warning)

View File

@ -279,7 +279,7 @@
(break-enabled #f)
(restart))))
(break-enabled #t)
(with-handlers ((not-break-exn?
(with-handlers ((exn:fail?
(lambda (exn)
(parameterize ((print-struct #t))
(printf "colorer thread: ~s\n" exn))

View File

@ -125,9 +125,7 @@
[else acc])))
(define/public (read-one-special index source line column position)
(raise (make-exn:special-comment
"msg"
(current-continuation-marks)
(raise (make-special-comment
1)))
(super-instantiate ())
(inherit set-snipclass)

View File

@ -66,7 +66,7 @@
(put-file #f #f)
internal-filename))
input-filename)])
(with-handlers ([not-break-exn?
(with-handlers ([exn:fail?
(lambda (exn)
(message-box
(string-constant error-saving)
@ -95,7 +95,7 @@
(get-file #f)
internal-filename))
input-filename)])
(with-handlers ([not-break-exn?
(with-handlers ([exn:fail?
(lambda (exn)
(message-box
(string-constant error-loading)
@ -551,7 +551,7 @@
(send this get-file-format))])
(when (is-a? this text%)
(send this set-file-format 'standard))
(with-handlers ([not-break-exn?
(with-handlers ([exn:fail?
(lambda (exn)
(show-autosave-error exn orig-name)
(set! auto-save-error? #t)

View File

@ -2314,10 +2314,10 @@
(define memory-text (make-object memory-text%))
(send memory-text hide-caret #t)
(define show-memory-text?
(or (with-handlers ([not-break-exn?
(or (with-handlers ([exn:fail:filesystem?
(lambda (x) #f)])
(directory-exists? (collection-path "cvs-time-stamp")))
(with-handlers ([not-break-exn?
(with-handlers ([exn:fail:filesystem?
(lambda (x) #f)])
(directory-exists? (build-path (collection-path "framework") "CVS")))))

View File

@ -110,7 +110,7 @@
(lambda ()
((current-create-new-window) filename)))]
[(filename make-default)
(with-handlers ([not-break-exn?
(with-handlers ([exn:fail?
(lambda (exn)
(message-box
(string-constant error-loading)

View File

@ -98,7 +98,7 @@
(define guard
(lambda (when p value thunk)
(with-handlers ([not-break-exn?
(with-handlers ([exn:fail?
(lambda (exn)
(error "excetion raised ~s, pref ~s val ~s, msg: ~a"
when
@ -116,7 +116,7 @@
(hash-table-get marshall-unmarshall
p
(lambda () (k data))))])
(with-handlers ([not-break-exn?
(with-handlers ([exn:fail?
(lambda (exn)
(begin0
(hash-table-get defaults p (lambda () (raise exn)))
@ -268,7 +268,7 @@
;; input determines if there is a dialog box showing the errors (and other msgs)
;; and result indicates if there was an error
(define (raw-save silent?)
(with-handlers ([not-break-exn?
(with-handlers ([exn:fail?
(lambda (exn)
(unless silent?
(message-box
@ -337,7 +337,7 @@
(define (for-each-pref-in-file parse-pref preferences-filename)
(let/ec k
(let ([input (with-handlers
([not-break-exn?
([exn:fail?
(lambda (exn)
(message-box
(string-constant error-reading-preferences)

View File

@ -47,8 +47,8 @@
(opt-lambda (text [start 0] [in-end #f])
(let* ([end (or in-end (send text last-position))]
[port (open-input-text-editor text start end)])
(with-handlers ([exn:read:eof? (lambda (x) #f)]
[exn:read? (lambda (x) #t)])
(with-handlers ([exn:fail:read:eof? (lambda (x) #f)]
[exn:fail:read? (lambda (x) #t)])
(let loop ()
(let ([s (read port)])
(or (eof-object? s)
@ -1183,7 +1183,7 @@
(format (string-constant enter-new-keyword) keyword-type)
(format (string-constant x-keyword) keyword-type))))])
(when new-one
(let ([parsed (with-handlers ((exn:read? (lambda (x) #f)))
(let ([parsed (with-handlers ((exn:fail:read? (lambda (x) #f)))
(read (open-input-string new-one)))])
(cond
[(and (symbol? parsed)