If you want to know where the exception was originated from, you can use Exception#backtrace method. With a little bit of parsing, you will get a line number and a method name. Gennady. On Jun 7, 2005, at 18:14, Xeno Campanoli wrote: > Assaph Mehr wrote: > >> Xeno Campanoli wrote: >> >>> The example on page 108 of pickaxe gives me the following syntax >>> error, for >>> instance: >>> >>> ./try4.rb:11: syntax error >>> rescue SystemCallError >>> ^ >>> xeno@linux:~/study/data> >>> >>> Presumably there is something simple I'm doing wrong. Please make a >>> suggestion, as I'm really stuck. >>> >> >> Can you post the whole file, or at least the context in which this >> statement is used? >> Kinda hard to catch syntax errors without the code. >> > Sorry, I tried to say before, I figured it out. It turns out you have > to put the rescue segment > on the bottom of the block, apparently, and I made it work when I did > that. I was however > fooled by the raise statement I left in afterwards. In taking out the > raise, and putting in > my own diagnostics, I now have mostly what I want, though it would be > nicer to get a line > number or statement indicator at the rescue point. For now I'm just > assigning the line to a > global to keep it around. If anyone can make a suggestion on that, it > would also be helpful. > > Thanks to the several people who have helped me on this. > > Sincerely, > > Xeno > >> >> >> >> > > > -- > Xeno Campanoli, xeno / eskimo.com, http://www.eskimo.com/~xeno > Pride before justice equals destabilization. > Power before truth equals destruction. > Profit before environment equals death. > >