From 8e22009ca145b1bd299ef5b3eb68b54227cf925b Mon Sep 17 00:00:00 2001 From: interp Date: Sat, 9 Nov 2002 18:25:20 +0000 Subject: [PATCH] Add another error handler in the reset from to catch errors occuring while running the servlet (perhaps with restored continuations). --- scheme/httpd/surflets/surflet-handler.scm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scheme/httpd/surflets/surflet-handler.scm b/scheme/httpd/surflets/surflet-handler.scm index b19e768..3e9e557 100644 --- a/scheme/httpd/surflets/surflet-handler.scm +++ b/scheme/httpd/surflets/surflet-handler.scm @@ -118,6 +118,7 @@ (register-session! instance-id 'no-return) (with-fatal-handler + ;; Catch conditions from get-servlet-rt-structure. (lambda (condition decline) (delete-instance! instance-id) (bad-gateway-error-response req path-string condition)) @@ -127,10 +128,17 @@ (+ (time) (options-instance-lifetime)) memo)) (reset - (with-cwd servlet-path - (with-names-from-rt-structure - servlet servlet-interface - (main req)))))))) + (with-fatal-handler + ;; Catch conditions that occur while running the servlet. + (lambda (condition decline) + (delete-instance! instance-id) + ;; Restore correct continuation with shift. + (shift unused + (bad-gateway-error-response req path-string condition))) + (with-cwd servlet-path + (with-names-from-rt-structure + servlet servlet-interface + (main req))))))))) (else ; We'll serve every non-scm file. ;; We need access to SEND-FILE-RESPONSE of ;; HTTPD-FILE-DIR-HANDLERS. In the official SUnet release, we