From: Robert Klemme Date: 2008-10-01T23:05:19+09:00 Subject: Re: "ensure" hiding actual error 2008/10/1 Thomas B. : > Nit Khair wrote: >> Now in real life, "@test = " calls a method elsewhere which may call >> other methods. So i am clueless as to where the error actually is. > > You caused another exception inside your ensure clause, so the previous > one got lost, so that's your mistake. If you want the original exception > to live to tell the tale, you cannot raise another in your ensure > clause. But if your ensure clause was correct, there wouldn't be any > problems with handling correctly the original exception. Adding to that: an uninitialized variable does not cause a syntax error. IIRC initially this was about a syntax error. Cheers robert -- remember.guy do |as, often| as.you_can - without end