Index: Makefile
==================================================================
--- Makefile
+++ Makefile
@@ -41,17 +41,17 @@
$(MODULES) : $(SOFILES) $(TARGDIR)/modules
cp $< $@
stmlrun : $(OFILES) stmlrun.scm requirements.scm stmlcommon.scm
- csc $(OFILES) stmlrun.scm -o stmlrun
+ csc $(CSCOPTS) $(OFILES) stmlrun.scm -o stmlrun
stml.so : stmlmodule.so
cp stmlmodule.so stml.so
stmlmodule.so : $(OFILES) stmlmodule.scm requirements.scm stmlcommon.scm
- csc $(OFILES) -s stmlmodule.scm
+ csc $(CSCOPTS) $(OFILES) -s stmlmodule.scm
# logging currently relies on this
#
$(LOGDIR) :
mkdir -p $(LOGDIR)
@@ -61,19 +61,19 @@
echo '(exit)'| csi -q ./tests/test.scm
# modules
#
%.so : %.scm
- csc -I modules/* -s $<
+ csc $(CSCOPTS) -I modules/* -s $<
%.o : %.scm
- csc -c $<
+ csc $(CSCOPTS) -c $<
# Cookie is a special case for now. Make a loadable so for test
# Complile it in by include (see dependencies above).
cookie.so : cookie.scm
- csc -s cookie.scm
+ csc i$(CSCOPTS) -s cookie.scm
clean :
rm -f *.o *.so
# $(CFILES): build/%.c: ../scm/%.scm ../scm/macros.scm
Index: stmlcommon.scm
==================================================================
--- stmlcommon.scm
+++ stmlcommon.scm
@@ -40,26 +40,55 @@
(session:close session))
(define (stml:main proc)
(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-error-message exn)
- (print-call-chain)
- (print "
")
- (print "")
- (for-each (lambda (var)
- (print "" (car var) " | " (cdr var) " |
"))
- (get-environment-variables))
- (print "
")
- (print ""))
-
+ (if (sdat-get-debugmode s:session)
+ (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-error-message exn)
+ (print-call-chain)
+ (print "
")
+ (print "")
+ (for-each (lambda (var)
+ (print "" (car var) " | " (cdr var) " |
"))
+ (get-environment-variables))
+ (print "
")
+ (print ""))
+ (begin
+ (with-output-to-file (conc "/tmp/stml-crash-" (current-process-id) ".log")
+ (lambda ()
+ (print "EXCEPTION")
+ (print " QUERY_STRING is: " (get-environment-variable "QUERY_STRING") )
+ (print "")
+ ;; (print " EXCEPTION: " ((condition-property-accessor 'exn 'message) exn))
+ (print-error-message exn)
+ (print-call-chain)
+ (print "")
+ (for-each (lambda (var)
+ (print (car var) "\t" (cdr var)))
+ (get-environment-variables))))
+ ;; return something useful to the user
+ (print "Content-type: text/html")
+ (print "")
+ (print " EXCEPTION ")
+ (print " Please notify support at " (sdat-get-domain s:session) " that the error log is stmlcrash-" (current-process-id) ".log
")
+ (print "")
+ ;; (print " EXCEPTION: " ((condition-property-accessor 'exn 'message) exn))
+ ;; (print-error-message exn)
+ ;; (print-call-chain)
+ (print "
")
+ (print "")
+ (for-each (lambda (var)
+ (print "" (car var) " | " (cdr var) " |
"))
+ (get-environment-variables))
+ (print "
")
+ (print "")))
(if proc (proc s:session) (stml:cgi-session s:session))
;; (raise-error)
;; (exit)
))