This repository was archived by the owner on Jul 19, 2025. It is now read-only.
Middleware pattern, tell Faraday to raise #13
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I got it in my head that the non-200 card was the perfect time to refactor to
the middleware pattern we discussed previously. It would make it trivial to add
an HTTP-Response-Checker into the stack.
After finishing that refactoring, I found that Faraday has its own middleware
to tell it to raise on non-200, so I just enabled that. Sigh.
I think this refactoring was a Good Thing anyway, so I'm opening the PR with it
included.
Once merged, CC will just have to change to the usage outlined in the
Invocation class docs.