Changing from exn? to exn:fail?
svn: r15902
This commit is contained in:
parent
89ec442c04
commit
bfe82b2f3d
|
@ -21,7 +21,7 @@
|
||||||
(first (get-binding* key bindings (list default))))
|
(first (get-binding* key bindings (list default))))
|
||||||
|
|
||||||
(define (get-binding* key bindings default)
|
(define (get-binding* key bindings default)
|
||||||
(with-handlers ([exn? (lambda _ default)])
|
(with-handlers ([exn:fail? (lambda _ default)])
|
||||||
(extract-binding/single key bindings)))
|
(extract-binding/single key bindings)))
|
||||||
|
|
||||||
(define (read-configuration-table table-file-name)
|
(define (read-configuration-table table-file-name)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
(define (get-name spec)
|
(define (get-name spec)
|
||||||
(if (symbol? spec)
|
(if (symbol? spec)
|
||||||
spec
|
spec
|
||||||
(with-handlers ([exn? (lambda _ #f)])
|
(with-handlers ([exn:fail? (lambda _ #f)])
|
||||||
((current-module-name-resolver) spec #f #f))))
|
((current-module-name-resolver) spec #f #f))))
|
||||||
(define to-be-copied-module-names
|
(define to-be-copied-module-names
|
||||||
(map get-name
|
(map get-name
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
(parameterize ([current-namespace new-namespace])
|
(parameterize ([current-namespace new-namespace])
|
||||||
(namespace-require scheme/base-module-spec)
|
(namespace-require scheme/base-module-spec)
|
||||||
(for-each (lambda (name)
|
(for-each (lambda (name)
|
||||||
(with-handlers ([exn? void])
|
(with-handlers ([exn:fail? void])
|
||||||
(when name
|
(when name
|
||||||
(namespace-attach-module server-namespace name))))
|
(namespace-attach-module server-namespace name))))
|
||||||
(append to-be-copied-module-names
|
(append to-be-copied-module-names
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
(define (make-coerce-safe? coerce)
|
(define (make-coerce-safe? coerce)
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(with-handlers ([exn? (lambda (x) #f)])
|
(with-handlers ([exn:fail? (lambda (x) #f)])
|
||||||
(and (coerce x) #t))))
|
(and (coerce x) #t))))
|
||||||
|
|
||||||
(define-syntax (define-coercion-match-expander stx)
|
(define-syntax (define-coercion-match-expander stx)
|
||||||
|
|
|
@ -83,9 +83,9 @@
|
||||||
(match-lambda
|
(match-lambda
|
||||||
[(list req)
|
[(list req)
|
||||||
(loop
|
(loop
|
||||||
(with-handlers ([exn? (lambda (e)
|
(with-handlers ([exn:fail? (lambda (e)
|
||||||
((error-display-handler) "dispatch-log.ss: Error writing log entry" e)
|
((error-display-handler) "dispatch-log.ss: Error writing log entry" e)
|
||||||
(with-handlers ([exn? (lambda (e) #f)])
|
(with-handlers ([exn:fail? (lambda (e) #f)])
|
||||||
(close-output-port log-p))
|
(close-output-port log-p))
|
||||||
#f)])
|
#f)])
|
||||||
(define the-log-p
|
(define the-log-p
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
(define ((make-url->valid-path url->path) u)
|
(define ((make-url->valid-path url->path) u)
|
||||||
(let loop ([up (url-path u)])
|
(let loop ([up (url-path u)])
|
||||||
#;(printf "~S~n" `(url->valid-path ,(url->string u) ,up))
|
#;(printf "~S~n" `(url->valid-path ,(url->string u) ,up))
|
||||||
(with-handlers ([exn? (lambda (exn)
|
(with-handlers ([exn:fail? (lambda (exn)
|
||||||
#;((error-display-handler) (exn-message exn) exn)
|
#;((error-display-handler) (exn-message exn) exn)
|
||||||
(if (empty? up)
|
(if (empty? up)
|
||||||
(raise exn)
|
(raise exn)
|
||||||
|
|
|
@ -130,7 +130,7 @@
|
||||||
(error (lambda (a b c) (error 'digest-parser "Malformed digest: ~v ~v ~v" a b c)))))
|
(error (lambda (a b c) (error 'digest-parser "Malformed digest: ~v ~v ~v" a b c)))))
|
||||||
|
|
||||||
(define (do-digest-parse str)
|
(define (do-digest-parse str)
|
||||||
(with-handlers ([exn? (lambda _ #f)])
|
(with-handlers ([exn:fail? (lambda _ #f)])
|
||||||
(with-input-from-string
|
(with-input-from-string
|
||||||
str
|
str
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
(values request? boolean?))])
|
(values request? boolean?))])
|
||||||
|
|
||||||
(define (ext:read-request conn host-port port-addresses)
|
(define (ext:read-request conn host-port port-addresses)
|
||||||
(with-handlers ([exn? (lambda (exn)
|
(with-handlers ([exn:fail? (lambda (exn)
|
||||||
(kill-connection! conn)
|
(kill-connection! conn)
|
||||||
(raise exn))])
|
(raise exn))])
|
||||||
(read-request conn host-port port-addresses)))
|
(read-request conn host-port port-addresses)))
|
||||||
|
|
|
@ -149,7 +149,7 @@
|
||||||
|
|
||||||
(define (ext:wrap f)
|
(define (ext:wrap f)
|
||||||
(lambda (conn . args)
|
(lambda (conn . args)
|
||||||
(with-handlers ([exn? (lambda (exn)
|
(with-handlers ([exn:fail? (lambda (exn)
|
||||||
(kill-connection! conn)
|
(kill-connection! conn)
|
||||||
(raise exn))])
|
(raise exn))])
|
||||||
(apply f conn args)
|
(apply f conn args)
|
||||||
|
@ -262,7 +262,7 @@
|
||||||
(apply + (map (lambda (range)
|
(apply + (map (lambda (range)
|
||||||
(- (cdr range) (car range)))
|
(- (cdr range) (car range)))
|
||||||
converted-ranges)))
|
converted-ranges)))
|
||||||
(with-handlers ([exn? (lambda (exn) (network-error 'output-file (exn-message exn)))])
|
(with-handlers ([exn:fail? (lambda (exn) (network-error 'output-file (exn-message exn)))])
|
||||||
(call-with-input-file file-path
|
(call-with-input-file file-path
|
||||||
(lambda (input)
|
(lambda (input)
|
||||||
(if (= (length converted-ranges) 1)
|
(if (= (length converted-ranges) 1)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
fb)
|
fb)
|
||||||
|
|
||||||
(define (file-box-set? fb)
|
(define (file-box-set? fb)
|
||||||
(with-handlers ([exn? (lambda _ #f)])
|
(with-handlers ([exn:fail? (lambda _ #f)])
|
||||||
(file-unbox fb)
|
(file-unbox fb)
|
||||||
#t))
|
#t))
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
;; kill this connection
|
;; kill this connection
|
||||||
(define (kill-connection! conn)
|
(define (kill-connection! conn)
|
||||||
#;(printf "K: ~a~n" (connection-id conn))
|
#;(printf "K: ~a~n" (connection-id conn))
|
||||||
(with-handlers ([exn? void])
|
(with-handlers ([exn:fail? void])
|
||||||
(cancel-timer! (connection-timer conn)))
|
(cancel-timer! (connection-timer conn)))
|
||||||
(kill-connection-w/o-timer! conn))
|
(kill-connection-w/o-timer! conn))
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
(map path/param-param (url-path url))))
|
(map path/param-param (url-path url))))
|
||||||
(let/ec esc
|
(let/ec esc
|
||||||
(for-each (lambda (p)
|
(for-each (lambda (p)
|
||||||
(with-handlers ([exn? void])
|
(with-handlers ([exn:fail? void])
|
||||||
(define l (read/string p))
|
(define l (read/string p))
|
||||||
(esc (cdr (assoc key l)))))
|
(esc (cdr (assoc key l)))))
|
||||||
ps)
|
ps)
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
(path/param-path f)
|
(path/param-path f)
|
||||||
(list (write/string
|
(list (write/string
|
||||||
(list* (cons key val)
|
(list* (cons key val)
|
||||||
(with-handlers ([exn? (lambda _ empty)])
|
(with-handlers ([exn:fail? (lambda _ empty)])
|
||||||
(filter (lambda (k*v) (not (equal? key (car k*v))))
|
(filter (lambda (k*v) (not (equal? key (car k*v))))
|
||||||
(read/string (first (path/param-param f)))))))))
|
(read/string (first (path/param-param f)))))))))
|
||||||
r))])])
|
r))])])
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
(define (initialize-blog! home)
|
(define (initialize-blog! home)
|
||||||
(define db (sqlite:open home))
|
(define db (sqlite:open home))
|
||||||
(define the-blog (make-blog db))
|
(define the-blog (make-blog db))
|
||||||
(with-handlers ([exn? void])
|
(with-handlers ([exn:fail? void])
|
||||||
(sqlite:exec/ignore db
|
(sqlite:exec/ignore db
|
||||||
(string-append
|
(string-append
|
||||||
"CREATE TABLE posts "
|
"CREATE TABLE posts "
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
"This is another post"
|
"This is another post"
|
||||||
(list)))))
|
(list)))))
|
||||||
(define the-blog
|
(define the-blog
|
||||||
(with-handlers ([exn? log-missing-exn-handler])
|
(with-handlers ([exn:fail? log-missing-exn-handler])
|
||||||
(with-input-from-file home read)))]
|
(with-input-from-file home read)))]
|
||||||
(set-blog-home! the-blog (path->string home))
|
(set-blog-home! the-blog (path->string home))
|
||||||
the-blog))
|
the-blog))
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
(define (initialize-blog! home)
|
(define (initialize-blog! home)
|
||||||
(define db (sqlite:open home))
|
(define db (sqlite:open home))
|
||||||
(define the-blog (make-blog db))
|
(define the-blog (make-blog db))
|
||||||
(with-handlers ([exn? void])
|
(with-handlers ([exn:fail? void])
|
||||||
(sqlite:exec/ignore db
|
(sqlite:exec/ignore db
|
||||||
(string-append
|
(string-append
|
||||||
"CREATE TABLE posts "
|
"CREATE TABLE posts "
|
||||||
|
|
|
@ -148,7 +148,7 @@
|
||||||
|
|
||||||
|
|
||||||
(define (with-errors-to-browser send/finish-or-back thunk)
|
(define (with-errors-to-browser send/finish-or-back thunk)
|
||||||
(with-handlers ([exn? (lambda (exn)
|
(with-handlers ([exn:fail? (lambda (exn)
|
||||||
(send/finish-or-back
|
(send/finish-or-back
|
||||||
`(html (head (title "Servlet Error"))
|
`(html (head (title "Servlet Error"))
|
||||||
(body ([bgcolor "white"])
|
(body ([bgcolor "white"])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user