Skip to content

fix(http1): replace reachable todo!/panic! with graceful handling - #57

Merged
alshdavid merged 1 commit into
mainfrom
agent/auto-flash/7a00084b4432
Oct 19, 2026
Merged

alshdavid merged 1 commit into
mainfrom
agent/auto-flash/7a00084b4432

Conversation

@alshdavid

Copy link
Copy Markdown
Collaborator

Summary

Replaces the two reachable panics called out in #25 with graceful handling.

  • handle_error now falls back to a bare 500 response if the builder rejects the response, instead of todo!().
  • The duplex reader used by body_stream no longer panics with .map_err(|_| panic!()). Read errors — including the writer being dropped mid-stream — now end the body stream cleanly so the client connection closes rather than the task unwinding.

Fixes #25

Notes

  • cargo check, cargo clippy --all-targets --workspace -- -D warnings, cargo test (32 passed) and cargo xfmt --check pass locally.
  • No new tests: the stream-error path needs a mid-response writer failure to reach; existing behavior is unchanged on the happy path.

@alshdavid
alshdavid force-pushed the agent/auto-flash/7a00084b4432 branch from 8131c4e to d46c32f Compare October 19, 2026 09:13
@alshdavid
alshdavid force-pushed the agent/auto-flash/7a00084b4432 branch from d46c32f to 5c72b88 Compare October 19, 2026 09:14
@alshdavid
alshdavid merged commit b28cc6f into main Oct 19, 2026
4 checks passed
@alshdavid
alshdavid deleted the agent/auto-flash/7a00084b4432 branch October 19, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace todo!()/panic!() on reachable error paths with graceful handling

1 participant