make-error-response:

more meaningful error description: show parsed uri
This commit is contained in:
vibr 2004-08-11 14:48:11 +00:00
parent 3abe557a86
commit 5f64e72cd0
1 changed files with 6 additions and 3 deletions

View File

@ -206,14 +206,16 @@
;; This error response requires one arg:
;; the value of the Allow field header,
;; which must be a list of valid methods for the requested resource
;; which must be a string listing the valid methods for the requested resource
;; Ex.: "GET, HEAD, POST"
((eq? code (status-code method-not-allowed))
(assert 1)
(create-response
(list (cons 'allow (car extras)))
(lambda (port options)
(generic-title port)
(format port "The method ~A is not allowed on the requested resource ~A.~%" (request-method req) (request-uri req))
(format port "The method ~A is not allowed on the requested resource ~A.~%"
(request-method req) (http-url->string (request-url req)))
(close-html port (cdr extras)))))
;; This error response requires one arg:
@ -241,7 +243,8 @@
'()
(lambda (port options)
(title-html port "Resource not found")
(format port "The requested resource ~A was not found on this server.\n" (request-uri req))
(format port "The requested resource ~A was not found on this server.\n"
(http-url->string (request-url req)))
(close-html port extras))))
((eq? code (status-code internal-error))