Add SEND-ERROR, that sends an error.

This commit is contained in:
interp 2003-01-24 16:02:29 +00:00
parent 7055289412
commit 3f3bf045de
2 changed files with 8 additions and 0 deletions

View File

@ -72,6 +72,7 @@
(export send/suspend ;send and suspend
send/finish ;send and finish
send ;just send (no finish, no suspend)
send-error ;send error response
set-surflet-data!
get-surflet-data
adjust-timeout ;adjusts timeout of current session
@ -151,6 +152,7 @@
(export send/suspend
send/finish
send
send-error
send-html/suspend
send-html/finish
send-html

View File

@ -280,6 +280,12 @@
(define (send response)
(shift unused (make-http-response response)))
;; REQ may be #f in some (most) cases.
(define (send-error status-code req . messages)
(shift unused (apply make-error-response
(cons status-code
(cons #f messages)))))
(define (make-http-response response)
(cond
((surflet-response? response)