Skip to content

chore: Improve EOF error messages.#1723

Merged
kavirajk merged 1 commit intomainfrom
kavirajk/improve-EOF-errors
Dec 1, 2025
Merged

chore: Improve EOF error messages.#1723
kavirajk merged 1 commit intomainfrom
kavirajk/improve-EOF-errors

Conversation

@kavirajk
Copy link
Copy Markdown
Contributor

@kavirajk kavirajk commented Nov 28, 2025

Summary

Before: most of the exit points in this PR returns either EOF or read: EOF without much context

After: These errors are written with more context. e.g: handsake failure, ping failure, reading block failure, etc. Along with more info like connection-id, remote-address, etc.

"send data: connection broken (EPIPE) to 127.0.0.1 (conn_id=3, block_cols=45, block_rows=77): read: EOF"

"handshake: failed to send hello to 127.0.0.1 (conn_id=5): read: EOF",

"ping: failed to send ping to 127.0.0.1 (conn_id=8): read: EOF"

We also make sure, we wrap the original error io.EOF so that consumer can still use helpers like errors.Is(err, io.EOF) without any problem.

Although one caveat is if any users where trying to use the actual error message like err.Error() == "read: EOF" that would fail now.

Related: #1464

Checklist

Delete items not relevant to your PR:

Before: most of the exit points in this PR returns either "EOF"  or "read:
EOF" without much context

After: These errors are written with more context. e.g: handsake
failure, ping failure, reading block failure, etc. Along with more info
like connection-id, remote-address, etc.

We also make sure, we wrap the original error `io.EOF` so that consumer
can still use helpers like errors.Is(err, io.EOF) without any problem.

Although one caveat is if any users where trying to use the actual error
message like `err.Error() == "read: EOF"` that would fail now.

Signed-off-by: Kaviraj <[email protected]>
@kavirajk kavirajk self-assigned this Nov 28, 2025
@kavirajk kavirajk requested a review from chernser November 28, 2025 10:27
@kavirajk kavirajk merged commit 86acad2 into main Dec 1, 2025
13 checks passed
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