From: Doug Jolley Date: 2012-07-07T00:32:52+09:00 Subject: Re: Rescue Failing in CGI Script Thanks for the input. I tried to follow your suggestions; but, it's still misbehaving. So, I would like to make sure that I fully understand your suggestions. > Make sure you wrapped the entire thing in the begin-rescue block. I'm not exactly sure what you mean by "entire thing". What I am saying is that begin-rescue-end blocks exist. When I introduce the error (either by using raise or by using my pet of divide-by-zero) I introduce it WITHIN the begin-rescue block. That should be sufficient, right? > Make sure you use "rescue Exception" (plain "rescue" only catches > StandardError). Understood. I do use the Exception argument in this case. In some of my earlier cases I used rescue with no arguments which may explain why some exceptions were caught and some were not (in those earlier cases). > Make sure that the actual work is not done in some threads. I've never written a multi-threaded script. My limited understanding would be that if there were multiple threads I would have had to have created them with Thread.new. There are no calls to Thread.new in this entire script. > Have you tried somehow running the code as a standalone and seeing in > the exceptions are catched? No, I haven't. I definitely agree that that could be very revealing. To get that job done I would have to somehow produce equivalent stand-alone code that would reproduce the problem. I'm thinking that that might be a very tall order. I'm concerned that I won't be able to develop equivalent stand-alone code that reproduces the problem. If I can't get this fixed some other way, I may have to give that a try. I certainly hope that it doesn't come to that. Thanks again for the input. If you have any further thoughts, I'd love to hear them. ... doug -- Posted via http://www.ruby-forum.com/.