[Haskell-cafe] Network.CGI and error handling
ketil at malde.org
Thu May 22 08:48:05 EDT 2008
I'm trying to implement a CGI, but I have encountered some problems
with handling program errors properly. I think it boils down to this:
The first program from the documentation at
cgiMain = output "Hello World!"
main = runCGI (handleErrors cgiMain)
works fine, and ouputs a page with the expected test. Replacing line
cgiMain = output $ error "Hello World!"
returns a blank page, although according to the documentation,
'handleErrors' should produce an error page (500) instead.
The error is recorded in the log, where one can read:
[Thu May 22 14:35:27 2008] [error] [client 10.1.9.227] test.cgi: Hello World!
I've toyed with various approaches, including using catchCGI and
replacing 'error' with other run-time failures, but only getting the
same result. Any hints?
(ghc 6.8.1, cgi-3001.1.5.1, apache 2.0, linux.)
If I haven't seen further, it is by standing in the footprints of giants
More information about the Haskell-Cafe