[plt-scheme] plt-web-server bug fix

From: Doug Orleans (dougorleans at gmail.com)
Date: Thu Jan 17 21:06:27 EST 2008

When I run the plt-web-server script in v., every hit results
in this message:

  dispatch-log.ss: Error writing log entry

I improved the error message, and also fixed the error.  A patch is below.

--dougorleans at gmail.com

Index: dispatch-log.ss
--- dispatch-log.ss	(revision 8358)
+++ dispatch-log.ss	(working copy)
@@ -79,7 +79,11 @@
              [(list req)
                (with-handlers ([exn? (lambda (e)
-                                       ((error-display-handler) "dispatch-log.ss: Error writing log entry" e)
+                                       ((error-display-handler)
+                                        (format "dispatch-log.ss: ~
+ 						 Error writing log entry: ~a"
+                                                (exn-message e))
+                                        e)
                                        (with-handlers ([exn? (lambda (e) #f)])
                                          (close-output-port log-p))
@@ -88,7 +92,8 @@
                          (unless (eq? log-p #f)
                            (close-output-port log-p))
-                         (let ([new-log-p (open-output-file log-path 'append)])
+                         (let ([new-log-p (open-output-file log-path
+                                                            #:exists 'append)])
                            (file-stream-buffer-mode new-log-p 'line)

Posted on the users mailing list.