How to fix a deadlock caused by open

后端 未结 1 1305
孤独总比滥情好
孤独总比滥情好 2020-12-22 08:56

I have is a deadlock, but I am not using any threads in my program. Plus, the error only happens about once every 1000 to 1500 function calls, making it very difficult to pi

相关标签:
1条回答
  • 2020-12-22 09:46

    You're not catching all exceptions here. When nothing is specified after rescue, it means that you're catching StandardError which is not at the root of Exceptions' hierarchy.

    If you want to make sure you're catching all exceptions and retry opening a URL (or whatever behavior you'd like), what you want to do is:

    rescue Exception => error
    
    0 讨论(0)
提交回复
热议问题