Ruby에서 Mechanize를 사용하여 양식을 사이트에 게시하여 데이터를 가져옵니다. 경우에 따라 오류가 발생합니다.ruby catch connection timeout error
too many connection resets (due to Operation timed out - Errno::ETIMEDOUT) after 13 requests on 34234234234242, last used 20.518373 seconds ago
이렇게하면 서버가 중단됩니다. 이 오류를 catch하고 나중에 다시 시도하여 처리하고 싶습니다.
나는begin
postForm(form)
rescue Errno::ETIMEDOUT
puts "=====>TimeOut ERROR!:"
end
을 시도하지만 오류를 잡기되지 않습니다. 내가 무엇이 누락 되었습니까?
감사합니다.
시도는 또 하나 개의 구조 예외를 두는 => 전자 –