From 3f3bf045de7259e931f19ef3cf63b3de2a367c60 Mon Sep 17 00:00:00 2001 From: interp Date: Fri, 24 Jan 2003 16:02:29 +0000 Subject: [PATCH] Add SEND-ERROR, that sends an error. --- scheme/httpd/surflets/packages.scm | 2 ++ scheme/httpd/surflets/surflet-handler.scm | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/scheme/httpd/surflets/packages.scm b/scheme/httpd/surflets/packages.scm index 40985f1..2de0216 100644 --- a/scheme/httpd/surflets/packages.scm +++ b/scheme/httpd/surflets/packages.scm @@ -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 diff --git a/scheme/httpd/surflets/surflet-handler.scm b/scheme/httpd/surflets/surflet-handler.scm index 0bcb1eb..b386705 100644 --- a/scheme/httpd/surflets/surflet-handler.scm +++ b/scheme/httpd/surflets/surflet-handler.scm @@ -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)