[claw-cvs] r63 - trunk/main/claw-core/src

achiumenti at common-lisp.net achiumenti at common-lisp.net
Thu Jul 17 14:54:54 UTC 2008


Author: achiumenti
Date: Thu Jul 17 10:54:54 2008
New Revision: 63

Modified:
   trunk/main/claw-core/src/server.lisp
Log:
updating error handling logic

Modified: trunk/main/claw-core/src/server.lisp
==============================================================================
--- trunk/main/claw-core/src/server.lisp	(original)
+++ trunk/main/claw-core/src/server.lisp	Thu Jul 17 10:54:54 2008
@@ -423,7 +423,6 @@
 
 (defmethod render-error-page ((clawserver clawserver) &optional (error-code +http-not-found+))
   (let ((connector (clawserver-connector clawserver)))
-    (setf (claw-return-code) +http-ok+)
     (page-render (make-instance 'error-page
                                 :title (format nil "Server error: ~a" error-code)
                                 :writer (connector-writer connector)
@@ -460,6 +459,16 @@
                                          for action = (cdr dispatcher)
                                          do (when (starts-with-subseq rel-script-name url) (return (funcall action))))))))))
       (or http-result
+          (let ((error-handler (and *claw-current-lisplet* 
+                                    (gethash (or 
+                                              (let ((return-code (claw-return-code)))
+                                                (if (= return-code +http-ok+)
+                                                    nil
+                                                    return-code))
+                                              +http-not-found+)
+                                             (lisplet-error-handlers *claw-current-lisplet*)))))
+            (when error-handler 
+              (funcall error-handler)))
           (with-output-to-string (*standard-output*) 
             (render-error-page clawserver (or 
                                            (let ((return-code (claw-return-code)))



More information about the Claw-cvs mailing list