Overview
Comment:Added initial implementation of catching errors and presenting data to user
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 75298ea6c2d30254fb30fef415c8e9dc7c5e20d5
User & Date: matt on 2012-12-13 04:57:52
Other Links: manifest | tags
Context
2012-12-13
05:41
Install used instead of cp for install, cleaned up stmlrun.scm a bit check-in: a53376324f user: kiatoaco tags: trunk
04:57
Added initial implementation of catching errors and presenting data to user check-in: 75298ea6c2 user: matt tags: trunk
2012-12-11
02:59
docs-tweak check-in: bec5075b24 user: matt tags: trunk
Changes

Modified stmlrun.scm from [b66c781934] to [ba66a834eb].

8
9
10
11
12
13
14
15
















16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
;;  This program is distributed WITHOUT ANY WARRANTY; without even the
;;  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
;;  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)







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|

|
|

|
|

|

|

|
|
|

|
|
|

|

|

|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
;;  This program is distributed WITHOUT ANY WARRANTY; without even the
;;  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
;;  PURPOSE.

;; (require-extension syntax-case)
;; (declare (run-time-macros))

(handle-exceptions
 exn   
 (begin
   (print "Content-type: text/html")
   (print "")
   (print "<html> <head> <title>EXCEPTION</title> </head> <body>")
   (print "   QUERY_STRING is: <b> " (get-environment-variable "QUERY_STRING") " </b> <br>")
   (print "<pre>")
   (print "   EXCEPTION: " ((condition-property-accessor 'exn 'message) exn))
   (print-call-chain)
   (print "</pre>")
   (print "<table>")
   (for-each (lambda (var)
	       (print "<tr><td>" (car var) "</td><td>" (cdr var) "</td></tr>"))
	     (get-environment-variables))
   (print "</table>")
   (print "</body></html>"))
 (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))