Add SEND-ERROR, that sends an error.
This commit is contained in:
		
							parent
							
								
									7055289412
								
							
						
					
					
						commit
						3f3bf045de
					
				| 
						 | 
				
			
			@ -72,6 +72,7 @@
 | 
			
		|||
  (export send/suspend			;send and suspend
 | 
			
		||||
	  send/finish			;send and finish
 | 
			
		||||
	  send				;just send (no finish, no suspend)
 | 
			
		||||
	  send-error			;send error response
 | 
			
		||||
	  set-surflet-data!
 | 
			
		||||
	  get-surflet-data
 | 
			
		||||
	  adjust-timeout		;adjusts timeout of current session
 | 
			
		||||
| 
						 | 
				
			
			@ -151,6 +152,7 @@
 | 
			
		|||
  (export send/suspend
 | 
			
		||||
	  send/finish
 | 
			
		||||
	  send
 | 
			
		||||
	  send-error
 | 
			
		||||
	  send-html/suspend
 | 
			
		||||
	  send-html/finish
 | 
			
		||||
	  send-html
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -280,6 +280,12 @@
 | 
			
		|||
(define (send response)
 | 
			
		||||
  (shift unused (make-http-response response)))
 | 
			
		||||
 | 
			
		||||
;; REQ may be #f in some (most) cases.
 | 
			
		||||
(define (send-error status-code req . messages)
 | 
			
		||||
  (shift unused (apply make-error-response 
 | 
			
		||||
		       (cons status-code 
 | 
			
		||||
			     (cons #f messages)))))
 | 
			
		||||
 | 
			
		||||
(define (make-http-response response)
 | 
			
		||||
  (cond
 | 
			
		||||
   ((surflet-response? response)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue