Skip to content

fix: handle response stream error in createHttpRequester#1609

Closed
zigzagdev wants to merge 1 commit intoalgolia:mainfrom
zigzagdev:fix/timer-leak-in-response
Closed

fix: handle response stream error in createHttpRequester#1609
zigzagdev wants to merge 1 commit intoalgolia:mainfrom
zigzagdev:fix/timer-leak-in-response

Conversation

@zigzagdev
Copy link

Summary

The response stream in createHttpRequester had no error event handler.

According to the Node.js stream documentation, if an error event handler is not added, the error will be thrown as an unhandled exception.

ref: https://nodejs.org/api/stream.html#event-error

Problem

When a network error occurs during response streaming:

  • response.on('error') was not handled
  • connectTimeout and responseTimeout were never cleared
  • Node.js would throw an unhandled exception

What I changed

Added response.on('error') to properly clear timeouts and resolve
the promise on response stream errors.

Test Results

スクリーンショット 2026-03-20 14 28 53

@github-actions
Copy link

Thanks for contributing to our API clients! Sorry to close your PR, but this repository is fully generated, you can port your changes to the API Clients Automation repository. If you need some guidance, feel free to open an issue or read our contribution guide.

@github-actions github-actions bot closed this Mar 20, 2026
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