File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11package ouroboros
22
33import (
4+ "errors"
45 "fmt"
56 "github.com/cloudstruct/go-ouroboros-network/muxer"
67 "github.com/cloudstruct/go-ouroboros-network/protocol"
@@ -11,6 +12,7 @@ import (
1112 "github.com/cloudstruct/go-ouroboros-network/protocol/localstatequery"
1213 "github.com/cloudstruct/go-ouroboros-network/protocol/localtxsubmission"
1314 "github.com/cloudstruct/go-ouroboros-network/protocol/txsubmission"
15+ "io"
1416 "net"
1517)
1618
@@ -101,7 +103,13 @@ func (o *Ouroboros) setupConnection() error {
101103 if ! ok {
102104 return
103105 }
104- o .ErrorChan <- fmt .Errorf ("muxer error: %s" , err )
106+ if errors .Is (err , io .EOF ) || errors .Is (err , io .ErrUnexpectedEOF ) {
107+ // Return a bare io.EOF error if error is EOF/ErrUnexpectedEOF
108+ o .ErrorChan <- io .EOF
109+ } else {
110+ // Wrap error message to denote it comes from the muxer
111+ o .ErrorChan <- fmt .Errorf ("muxer error: %s" , err )
112+ }
105113 // Close connection on muxer errors
106114 o .Close ()
107115 }()
You can’t perform that action at this time.
0 commit comments