From: Zach Dennis Date: 2004-11-05T14:47:04+09:00 Subject: Re: rescuing exceptions Joel VanderWerf wrote: > Zach Dennis wrote: > >> I haven't seen a reply to this thread, so I'll give it one more go..... >> >> When I rescue an Exception shouldn't it be my responsiblity as the >> developer to handle it and print it to STDOUT or STDERR? Why does >> Ruby 1.8.2 still output something to STDERR!!? Is this just how it >> works? >> >> Zach >> >> ----CODE----- >> class MyException < Exception; end >> >> def method >> raise MyException >> end >> >> begin >> method >> rescue MyException >> #shouldn't this rescue the error? >> # --Why does it still get outputted to my screen? >> end > > > Are you sure that code, exactly, prints something to stderr or stdout? > I can't reproduce it here with 1.8.2 or 1.9 snapshots. Joel you are a lifesaver. Thank you for responding....I stepped out of my IDE shell and test just via command line. And you are correct, it doesn't print to stdout or stderr. So then I looked at the difference between how my IDE was running Ruby and me personally on the CLI. The debug "-d" option made the difference when calling Ruby. Bah, I guess that is what happens when you get real comfortable in an IDE. Thanks so much Joel for responding, otherwise I'd probably still be at this minor roadblock tomorrow! Zach