Have you looked into using the begin...rescue...end syntax? It's basically a try/catch (but Ruby doesn't understand the meaning of 'try'.... haha). begin sh(blablabla) puts "do this" rescue puts "do this" end puts "do this" That is, if sh() raises an exception. Otherwise, you'd have to raise "Oops" unless sh(blablala) Give it a try... M.T.