From: Doug Jolley Date: 2012-07-06T02:40:31+09:00 Subject: Rescue Failing in CGI Script I have a Ruby 1.8.7 CGI script. Practically speaking, the whole thing is included within a begin-rescue block. The script is structured such that if all goes well the content of the desired web page is passed as a block to cgi.out causing it to be sent to standard out with an appropriate header. That all works as expected. There is also a rescue-end block. This block passes (as another block) the content of an error page to cgi.out. The theory is that when an exception is raised control will be transferred to the rescue-end block and and the error page will be displayed. I have done this before and it has worked as expected for some (but not all) errors. For example, an error that typically gets caught and sent to the rescue block is a divide-by-zero error. Other errors result in the typical Apache error page. For some reason, in my current lashup (as described above) no errors get caught. If I through in a divide-by-zero (e.g. x=1/0) I get an Apache error and not the error page that is in my rescue block. Being a cgi script this is difficult to debug and I'm afraid that posting code would be a nightmare. So, what I'm seeking is suggestions on how I might debug this. Any thoughts? Thanks for any input. ... doug -- Posted via http://www.ruby-forum.com/.