Void value expression for 'retry'

following code returns,
retry.rb:13: void value expression

What is wrong with this code?

#!/usr/bin/env ruby

retry_count = 0
retry_max = 4

begin
sleep 30

rescue Interrupt
if ( retry_count < retry_max)
retry_count++
retry
end
rescue
raise
end

Thanks,
Mohammad

On 10/1/07, Mohammad K. [email protected] wrote:

retry_max = 4

begin
sleep 30

rescue Interrupt
if ( retry_count < retry_max)
retry_count++

retry_count++ is not valid ruby code. so that could be causing some
problems.

            retry

Mohammad K. wrote:

end

Thanks,
Mohammad

Ruby doesn’t have the post-increment (++) operator. Use retry_count += 1
instead.