In Perl I handle errors with:
eval{
};
if($@) {
}
In Ruby I have used:
begin
rescue Exception => e
sleep 2
end
Is this correct way to do in Ruby, and will this work if the Internet or a server goes down? If the above is wrong are there any ways of doing it in Ruby similar to Perl?