From: Logan Capaldo Date: 2006-03-09T10:54:56+09:00 Subject: Re: catch throw ? On Mar 8, 2006, at 8:35 PM, Paatsch, Bernd wrote: > > Hello, > > I just started using catch and throw. Therefore this question might > be an > easy one. > > I have multiple ruby files. In one of the files I like to throw and > then in > the main function in a different file I like to catch the throw. > Is this > possible or do throw/catch need to be in the same file? > > > Example: > fileOne.rb > > def somefunct > .... > throw :quit_script > .... > end > > fileTwo.rb > catch :quit_script > ... > end > > Thx, > Bernd They have to be in the same call chain. so if fileTwo require's fileOne.rb and fileTwo's code looks like catch :quit_script do ... somefunct() ... end it will work