Better handle the web server exception handler not returning 2 values

This commit is contained in:
Christopher Baines 2025-03-03 10:56:36 +00:00
parent f41d1853ce
commit a6c96aa1da
2 changed files with 68 additions and 1 deletions

View file

@ -273,7 +273,33 @@ on the procedure being called at any particular time."
(call-with-values
(lambda ()
(exception-handler exn request))
return))
(match-lambda*
((response body)
(call-with-values
(lambda ()
(sanitize-response request response body))
return))
(other
(call-with-values
(lambda ()
(default-exception-handler
(make-exception-with-irritants
(list (make-exception-with-message
(simple-format
#f
"wrong number of values returned from exception handler, expecting 2, got ~A"
(length other)))
exception-handler))
request))
(match-lambda*
((response body)
(call-with-values
(lambda ()
(sanitize-response
request
response
body))
return))))))))
(lambda ()
(start-stack
#t