From f1929d9dde804acea2cf36d50fe0971819e88176 Mon Sep 17 00:00:00 2001 From: mi-wada Date: Mon, 19 Feb 2024 14:54:10 +0900 Subject: [PATCH] Add instructions on how to inherit the default exceptions to the README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 87acc1c..0d28131 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,14 @@ retry_options = { } ``` +If you want to inherit default exceptions, do it this way. + +```ruby +retry_options = { + exceptions: Faraday::Retry::Middleware::DEFAULT_EXCEPTIONS + [Faraday::ResourceNotFound, Faraday::UnauthorizedError] +} +``` + #### Specify on which response statuses to retry By default the `Retry` middleware will only retry the request if one of the expected exceptions arise.