Debian Codegraph @

lab/cgi-errors-to-browser.ss

raw
1 (module ()
2 #| set the error handler to output an error page should
3 an error occur |#
4 (error-handler
5 (lambda (who msg . args)
6 (display "Content-type: text/html\n\n")
7 (display "<font color=\"red\"><pre>")
8 (if who
9 (printf "Error: ~a.\n" (apply format msg args))
10 (printf "Error in ~a: ~a.\n" who (apply format msg args)))
11 (display "</pre></font>")
12 (exit 0))))