Skip to content

Conversation

@tmcgilchrist
Copy link
Collaborator

@tmcgilchrist tmcgilchrist commented Nov 27, 2025

Originally the code would only wait on the response and if H2 encountered an error, it would call error_handler instead of response_handler and because error_handler was not defined then errors were sliently ignored.

This fix adds error handling with promise racing and probably addresses this issue #64

Now when an H2 error occurs (like a 404):

  1. H2 calls the error_handler instead of hanging
  2. The error_handler resolves the error_promise
  3. Eio.Fiber.first races the response fiber against the error fiber
  4. If it's an error, it gets converted to a proper exception with a descriptive message

Originally the code would only wait on the response and if H2
encountered an error, it would call error_handler instead of
response_handler and because error_handler was not defined then errors
were sliently ignored.

This fix adds error handling with promise racing.
@wokalski
Copy link
Contributor

This looks sensible to me 👍

@wokalski wokalski self-requested a review November 28, 2025 16:21
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.

2 participants