From: Dhruva Sagar Date: 2010-10-07T11:44:55+09:00 Subject: Re: rescuing a function --000325574b5eeeef990491fde057 Content-Type: text/plain; charset=UTF-8 Are you sure that you don't have *args in your code instead of just args ? In case of *args the warning makes sense... -- Thanks & Regards, Dhruva Sagar. On Thu, Oct 7, 2010 at 07:44, Courtland Allen wrote: > Hello, > > I've normally handled exceptions by "rescuing functions" in roughly this > manner: > > def test_function(args) > puts "blah blah blah" > rescue Exception=>e > puts "blah blah blah: #{args.inspect}" > end > > However, I'm using a new IDE now that's giving me a warning about the > reference to "args" in the rescue clause: "Local variable can be > uninitialized." I figured that's impossible, since it's a required argument > to the function. Should I just ignore the warning, or am I actually doing > something wrong? I suppose the alternative would be: > > def test_function(args) > begin > puts "blah blah blah" > rescue Exception=>e > puts "blah blah blah: #{args.inspect}" > end > end > > > -- > *Courtland Allen* > --000325574b5eeeef990491fde057--