From: Robert Date: 2003-06-03T03:07:52+09:00 Subject: Re: Return from ensure "Gennady" schrieb im Newsbeitrag news:000f01c32924$b93733b0$c20ca8c0@gfb... > > But you would to this in an rescue clause. If all is well, return the > > value otherwise rethrow by simple writing "raise" on a line. (See the > > example in the referenced chapter.) > > I just wanted to save on typing ;-). Now I save the data in "ensure" in an > array initialized before my begin/ensure/end block and return it after the > block. In case of an excetpion, the data is still preserved and no return > executed. It even conveys the intent much better. Much better. Although I have to admit what kind of operation this is that is meant to return some data which it apparently does retrieve successfully even in case of an exception. Cheers robert