-
Book Overview & Buying
-
Table Of Contents
Polished Ruby Programming - Second Edition
By :
It's a fact of life, at least for a programmer, that some things fail all the time, but other things only fail occasionally. For those things that fail all the time, there is no point in retrying them. For example, if you call a method and it raises ArgumentError because you are calling it with the wrong number of arguments:
nil.to_s(16)
You probably don't want to retry it, unless you expect that something will be redefining NilClass#to_s to accept an argument.
However, in many cases, especially those involving network requests, it is common to encounter transient errors. In these cases, it makes sense to retry if an error occurs. After all, there are multiple reasons why a network request might fail. Maybe the program at the other end of the request crashed and is being restarted. Maybe a construction crew accidentally cut a network cable between your computer and the computer you are connecting to, and failover to an alternative route hasn&apos...
Change the font size
Change margin width
Change background colour