docs: Clarify default_retry_on retry behavior for exceptions (#1754)

* docs: Clarify exceptions retried by default_retry_on in retry policy tutorial

- Added a remark in the tutorial explaining that the `default_retry_on` function retries on any exception except for the following:
  - ValueError
  - TypeError
  - ArithmeticError
  - ImportError
  - LookupError
  - NameError
  - SyntaxError
  - RuntimeError
  - ReferenceError
  - StopIteration
  - StopAsyncIteration
  - OSError

* http status codes

---------

Co-authored-by: Itay Etelis <itay.etelis@ibm.com>
Co-authored-by: isaac hershenson <ihershenson@hmc.edu>
This commit is contained in:
Itay Etelis
2024-09-18 20:48:10 +00:00
committed by GitHub
co-authored by Itay Etelis isaac hershenson
parent babcf10c1c
commit 22c78050dd
+22
View File
@@ -82,6 +82,28 @@
"RetryPolicy()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"By default, the `retry_on` parameter uses the `default_retry_on` function, which retries on any exception except for the following:\n",
"\n",
"* `ValueError`\n",
"* `TypeError`\n",
"* `ArithmeticError`\n",
"* `ImportError`\n",
"* `LookupError`\n",
"* `NameError`\n",
"* `SyntaxError`\n",
"* `RuntimeError`\n",
"* `ReferenceError`\n",
"* `StopIteration`\n",
"* `StopAsyncIteration`\n",
"* `OSError`\n",
"\n",
"In addition, for exceptions from popular http request libraries such as `requests` and `httpx` it only retries on 5xx status codes."
]
},
{
"cell_type": "markdown",
"metadata": {},