From: ahoward Date: 2002-11-10T03:02:49+09:00 Subject: Re: help - redirect/flush/sync problem On Sun, 10 Nov 2002, ts wrote: > No, not really [snip] > This time you have caught the exception [snip] what i was getting at was that i wasn't catching ALL exceptions... what i have now is ... rescue NameError => err $stderr.puts err rescue => err $stderr.puts err ... and this works for both examples (foo, 1/0)... i was under the impression that a : rescue => err clause would catch all errors, since i thought all errors were subclasses of StandardError - this obviously is not the case. since i had to explicitly catch the NameError in order to redirect to file. my goal was to redirect ALL stderr to file in cgi programs, since any stderr output causes apache to print an error page, and also catch all exceptions - in this was, i can generate meaningfull error pages when debugging cgi programs. any better ways to do this you know of? the advantage of this technique is that one can check to see if anything was written the stderr file, and decide what to do then, if $stderr is not redirected you do not have this option. -a -- ==================================== | Ara Howard | NOAA Forecast Systems Laboratory | Information and Technology Services | Data Systems Group | R/FST 325 Broadway | Boulder, CO 80305-3328 | Email: ahoward@fsl.noaa.gov | Phone: 303-497-7238 | Fax: 303-497-7259 ====================================