Retry modeled on try-catch, with durations.

This has some benefits as far as exception handling and logging, since the user can provide a `case` block that catches only the exceptions relevant to their use case and do logging with a logger provided there.