Better contracts
svn: r12317
This commit is contained in:
parent
f33a5dbf26
commit
05f36015d5
|
@ -19,10 +19,10 @@
|
|||
"with-errors-to-browser"
|
||||
(test-case
|
||||
"Basic"
|
||||
(check-pred list? (with-errors-to-browser (lambda (x) x) (lambda () (error 'error "Hey!")))))
|
||||
(check-pred list? (let/ec esc (with-errors-to-browser esc (lambda () (error 'error "Hey!"))))))
|
||||
(test-case
|
||||
"Basic (succ)"
|
||||
(check-true (with-errors-to-browser (lambda (x) x) (lambda () #t)))))
|
||||
(check-true (let/ec esc (with-errors-to-browser esc (lambda () #t))))))
|
||||
|
||||
(test-suite
|
||||
"redirect-to"
|
||||
|
|
|
@ -547,7 +547,7 @@ functions of interest for the servlet developer.}
|
|||
|
||||
@defthing[see-other redirection-status?]{A @scheme[redirection-status?] for "see-other" redirections.}
|
||||
|
||||
@defproc[(with-errors-to-browser [send/finish-or-back (response? . -> . void?)]
|
||||
@defproc[(with-errors-to-browser [send/finish-or-back (response? . -> . request?)]
|
||||
[thunk (-> any)])
|
||||
any]{
|
||||
Calls @scheme[thunk] with an exception handler that generates an HTML error page
|
||||
|
|
|
@ -32,9 +32,6 @@
|
|||
(pre ,(exn->string exn)))))))])
|
||||
(thunk)))
|
||||
|
||||
; XXX contract
|
||||
(provide
|
||||
with-errors-to-browser)
|
||||
(provide/contract
|
||||
[redirect-to
|
||||
(->* (string?) (redirection-status? #:headers (listof header?))
|
||||
|
@ -42,4 +39,9 @@
|
|||
[redirection-status? (any/c . -> . boolean?)]
|
||||
[permanently redirection-status?]
|
||||
[temporarily redirection-status?]
|
||||
[see-other redirection-status?])
|
||||
[see-other redirection-status?]
|
||||
[with-errors-to-browser
|
||||
((response? . -> . request?)
|
||||
(-> any)
|
||||
. -> .
|
||||
any)])
|
||||
|
|
Loading…
Reference in New Issue
Block a user