Retry Strategies
Explain retry and retryWhen (or the modern retry with config) for automatically re-attempting a failed Observable.
Some failures are transient — a flaky network blip, a momentarily overloaded server returning a 503 — and automatically retrying the operation is often better UX than immediately surfacing an error to the user. RxJS's retry operator re-subscribes to the source Observable when it errors, effectively restarting the entire operation from scratch, up to a configurable number of attempts.
It's like redialing a phone number that gave a busy signal — retrying immediately and repeatedly is rude and unlikely to help, but waiting a bit longer each time you redial (exponential backoff) gives the other line a real chance to free up before you try again.