Skip to content
This repository was archived by the owner on Feb 1, 2026. It is now read-only.

fix: handle silent I/O error in async serialization#1

Closed
erayack wants to merge 1 commit into
HelixDB:masterfrom
erayack:feature/error-format-improvements
Closed

fix: handle silent I/O error in async serialization#1
erayack wants to merge 1 commit into
HelixDB:masterfrom
erayack:feature/error-format-improvements

Conversation

@erayack
Copy link
Copy Markdown

@erayack erayack commented Jan 12, 2026

Problem

I/O errors occurring during async serialization in Format::serialize_to_async could fail to propagate properly, potentially leading to silent failures when writing response bodies.

Changes

  • src/error.rs: Added From<std::io::Error> implementation to convert I/O errors into GatewayError::InternalError, for proper error handling and HTTP 500 responses
  • src/format.rs: Enhanced serialize_to_async to explicitly convert write errors using .map_err(GatewayError::from)?, guaranteeing I/O failures are caught and reported

Testing

Added test_serialize_to_async_propagates_write_error test case that simulates a failing async writer and verifies the error is properly propagated as GatewayError::InternalError.

@erayack erayack closed this by deleting the head repository May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant