About CGI

Started by Endo on 18-May-2010/17:20:21-7:00
If an error occurs in a CGI script then does the rebol.exe CGI process stay open in the background? If it does not, how? When rebol.exe started in CGI mode it terminates itself if an error occured?
I'll try to find out the answer to that. In my shared host environment, the server limits the time any script is allowed to execute, quickly killing any long running process (they've never complained to me in 6+ years about any troublesome processes).
It depends on the nature of the error. Generally you want to ensure you end with a QUIT (rather than a HALT or a console error). Easy way to make (almost!) certain of that is to: 1. ensure HALT can't happen by accident: halt: :quit 2. wrap all the code in an attempt: attempt [--all the cgi code--] quit A slightly more sophisticated version of that (2) is here: http://www.rebol.org/view-script.r?script=cgi-debug.r
Thanks a lot.
This answer was posted in AltME: It self terminates. if you're running a script in a console, the error makes you drop back to the console. If you're running cgi, there is no console to drop back to ...

Reply