Skip to content

Commit

Permalink
Add instructions on how to inherit the default exceptions to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-wada authored and iMacTia committed Feb 20, 2024
1 parent 0b769c4 commit f1929d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f1929d9

Please sign in to comment.