def retry_on_error(times: 3) try = 0 begin try += 1 yield rescue retry if try < times raise end end retry_on_error { do_something } ...
確定! 回上一頁