Index: stmlrun.scm ================================================================== --- stmlrun.scm +++ stmlrun.scm @@ -10,40 +10,56 @@ ;; PURPOSE. ;; (require-extension syntax-case) ;; (declare (run-time-macros)) - -(include "requirements.scm") -(declare (uses cookie)) -(declare (uses html-filter)) -(declare (uses misc-stml)) -(declare (uses formdat)) -(declare (uses stml)) -(declare (uses session)) -(declare (uses setup)) ;; s:session gets created here -(declare (uses sqltbl)) -(declare (uses keystore)) - -(sdat-set-log-port! s:session ;; (current-error-port)) - (open-output-file (sdat-get-logfile s:session) #:append)) - -;; (s:log "HTTP_COOKIE" (get-environment-variable "HTTP_COOKIE")) -;; (s:log "stdin-dat=" (slot-ref s:session 'stdin-dat)) - -(s:validate-inputs) - -(session:run-actions s:session) - -(sdat-set-pagedat! s:session - (append (sdat-get-pagedat s:session) - (s:call (sdat-get-toppage s:session)))) - -(if (eq? (sdat-get-page-type s:session) 'html) ;; default is html. - (session:cgi-out s:session) - (session:alt-out s:session)) - -(session:save-vars s:session) - -(session:close s:session) - -(exit) +(handle-exceptions + exn + (begin + (print "Content-type: text/html") + (print "") + (print " EXCEPTION ") + (print " QUERY_STRING is: " (get-environment-variable "QUERY_STRING") "
") + (print "
")
+   (print "   EXCEPTION: " ((condition-property-accessor 'exn 'message) exn))
+   (print-call-chain)
+   (print "
") + (print "") + (for-each (lambda (var) + (print "")) + (get-environment-variables)) + (print "
" (car var) "" (cdr var) "
") + (print "")) + (include "requirements.scm") + (declare (uses cookie)) + (declare (uses html-filter)) + (declare (uses misc-stml)) + (declare (uses formdat)) + (declare (uses stml)) + (declare (uses session)) + (declare (uses setup)) ;; s:session gets created here + (declare (uses sqltbl)) + (declare (uses keystore)) + + (sdat-set-log-port! s:session ;; (current-error-port)) + (open-output-file (sdat-get-logfile s:session) #:append)) + + ;; (s:log "HTTP_COOKIE" (get-environment-variable "HTTP_COOKIE")) + ;; (s:log "stdin-dat=" (slot-ref s:session 'stdin-dat)) + + (s:validate-inputs) + + (session:run-actions s:session) + + (sdat-set-pagedat! s:session + (append (sdat-get-pagedat s:session) + (s:call (sdat-get-toppage s:session)))) + + (if (eq? (sdat-get-page-type s:session) 'html) ;; default is html. + (session:cgi-out s:session) + (session:alt-out s:session)) + + (session:save-vars s:session) + + (session:close s:session) + + (exit))