[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.3.99.0.9, 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)
               (loop
                (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))
                                        #f)])
@@ -88,7 +92,8 @@
                        (begin
                          (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)
                            new-log-p))
                        log-p))


Posted on the users mailing list.