Skip to content

Conversation

Prabhat1308
Copy link
Contributor

fixes #3156

Copy link
Member

@sukunrt sukunrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just use:
StreamError from:

https://github.com/libp2p/go-libp2p/blob/master/core/network/mux.go#L17

You can set the ErrorCode to 0 and use the appropriate Remote flag.

@Prabhat1308
Copy link
Contributor Author

Prabhat1308 commented Mar 17, 2025

Removed the custom defined StreamError and using the already defined one from mux.go. We do get the Network.ErrReset from here now

return []error{ErrReset, s.TransportError}

Also on the remote flags I have assumed the read errors are initiated by the remote peer while write ones are initiated by the local peer. Let me know if this assumption is wrong .

@sukunrt
Copy link
Member

sukunrt commented Mar 17, 2025

You can just use the remote field on webtransport.StreamError

@Prabhat1308 Prabhat1308 requested a review from sukunrt March 17, 2025 14:02
@sukunrt
Copy link
Member

sukunrt commented Mar 18, 2025

Thanks @Prabhat1308

@sukunrt sukunrt merged commit 1f6232d into libp2p:master Mar 21, 2025
9 of 10 checks passed
@Prabhat1308 Prabhat1308 deleted the pv/informative_error branch March 21, 2025 15:47
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.

Return wrapped network.ErrReset error type with more info
3 participants