Skip to content

Fix streaming error handling to be compatible with middleware stack - #637

Open
anakinj wants to merge 1 commit into
alexrudall:mainfrom
anakinj:fix/error-handling-when-streaming
Open

anakinj wants to merge 1 commit into
alexrudall:mainfrom
anakinj:fix/error-handling-when-streaming

Conversation

@anakinj

@anakinj anakinj commented Mar 30, 2026

Copy link
Copy Markdown

When streaming, HTTP errors were handled by a detached instance of Faraday::Response::RaiseError from within the on_data callback. This caused issues with custom middleware never getting a chance to see or handle these errors.

The proposed fix is to instead of raising errors manually, we build the raw body for the registered middleware to react on.

The original behavior was first introduced in #344

#591 and #635 are touching the issue a bit, but those are focusing on fixing the problem described in #479

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant