From: Peter Bailey Date: 2009-02-13T21:30:42+09:00 Subject: Re: Error handling in Ruby scripts snex wrote: > On Feb 12, 1:38�pm, Peter Bailey wrote: >> input file that's just bad. So, my Alchemy Ruby code fails, because >> class Alchemy >> � � `alchemy #{file} -t1 -Zc1 -Zm2 -b -c256 -8 -Za4 -Zd 300 300 .300 -o` >> � end >> end >> -- >> Posted viahttp://www.ruby-forum.com/. > > its not going to work the way you are doing it. backquotes cant tell > if the command inside them completed "successfully" or not, they just > run it and return STDOUT. you need to analyze the return status of the > command, then raise an error if it failed. OK. Thanks. Well, obviously, I've got to use backquotes or "system" in this case. Being a Windows command shell program, a successful result would be "0" in Windows, "1" or anything else if unsuccessful. Can I capture that as part of my "raise?" -- Posted via http://www.ruby-forum.com/.