The cheapest bug to catch is the one a reviewer circles on line 40. The expensive one never shows up as a bad line it ships as the wrong approach , clean and green. Your retry loop is correct and also retrying in the wrong layer.
Source: [Dev.to](https://dev.to/freema/most-code-review-catches-bugs-i-shipped-one-that-argues-with-the-design-1h0h)