make-error-response:
more meaningful error description: show parsed uri
This commit is contained in:
		
							parent
							
								
									3abe557a86
								
							
						
					
					
						commit
						5f64e72cd0
					
				| 
						 | 
				
			
			@ -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))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue