Handle when the wrong number of values is returned in the web server
This commit is contained in:
parent
42d885c553
commit
8a99f51bf9
1 changed files with 19 additions and 2 deletions
|
@ -206,8 +206,25 @@ on the procedure being called at any particular time."
|
|||
stack
|
||||
(current-error-port)
|
||||
2)))))))
|
||||
(lambda (response body)
|
||||
(sanitize-response request response body))))
|
||||
(match-lambda*
|
||||
((response body)
|
||||
(sanitize-response request response body))
|
||||
(other
|
||||
(let ((stack (make-stack #t))
|
||||
(exception
|
||||
(make-exception-with-irritants
|
||||
(list (make-exception-with-message
|
||||
(simple-format
|
||||
#f
|
||||
"wrong number of values returned from handler, expecting 2, got ~A"
|
||||
(length other)))
|
||||
handler))))
|
||||
(print-exception
|
||||
(current-error-port)
|
||||
(stack-ref stack 2)
|
||||
'%exception
|
||||
(list exception))
|
||||
(raise-exception exception))))))
|
||||
#:unwind? #t)))))
|
||||
(with-exception-handler
|
||||
write-response-exception-handler
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue