Đoạn mã sau đôi khi tạo ra lỗi "reset reset by peer". Bất cứ ai có thể chỉ cho tôi cách xử lý ngoại lệ này?Làm thế nào để bắt lỗi Kết nối thiết lập lại bởi peer (Errno :: ECONNRESET)
doc = Nokogiri::HTML(open(url))
Connection reset by peer (Errno::ECONNRESET)
Cảm ơn. Thực sự học được rất nhiều từ stackoverflow :) – revolver
Thông tin thêm về mẫu thử lại này của Ruby: http://blog.mirthlab.com/2012/05/25/cleanly-retrying-blocks-of-code-after-an-exception -in-ruby/ –