Add SEND-ERROR, that sends an error.
This commit is contained in:
parent
7055289412
commit
3f3bf045de
|
@ -72,6 +72,7 @@
|
||||||
(export send/suspend ;send and suspend
|
(export send/suspend ;send and suspend
|
||||||
send/finish ;send and finish
|
send/finish ;send and finish
|
||||||
send ;just send (no finish, no suspend)
|
send ;just send (no finish, no suspend)
|
||||||
|
send-error ;send error response
|
||||||
set-surflet-data!
|
set-surflet-data!
|
||||||
get-surflet-data
|
get-surflet-data
|
||||||
adjust-timeout ;adjusts timeout of current session
|
adjust-timeout ;adjusts timeout of current session
|
||||||
|
@ -151,6 +152,7 @@
|
||||||
(export send/suspend
|
(export send/suspend
|
||||||
send/finish
|
send/finish
|
||||||
send
|
send
|
||||||
|
send-error
|
||||||
send-html/suspend
|
send-html/suspend
|
||||||
send-html/finish
|
send-html/finish
|
||||||
send-html
|
send-html
|
||||||
|
|
|
@ -280,6 +280,12 @@
|
||||||
(define (send response)
|
(define (send response)
|
||||||
(shift unused (make-http-response 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)
|
(define (make-http-response response)
|
||||||
(cond
|
(cond
|
||||||
((surflet-response? response)
|
((surflet-response? response)
|
||||||
|
|
Loading…
Reference in New Issue