Skip to main content
Fetch fails in two places, and they need different handling. A rejected request raises. Nothing was fetched and nothing was billed. A failed page does not raise: the call returns 200, and that URL’s result carries status = "error" with an error.code. So a caller has to do both — catch around the call, and branch inside the loop.
Branch on status, not on whether markdown is set. A format the page could not produce is unset on an otherwise successful result.
Treat an unrecognized error.code as a generic failure rather than rejecting the result — the set grows. The message beside it is prose for logs, and its wording can change; never parse it. The per-URL codes and the request-level codes are listed in Reference.