Skip to content

Commit

Permalink
recover from panics in go-routine in client-side io.Reader encoder (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nonsense committed Sep 25, 2023
1 parent e1090ba commit b9bb01c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/rpcenc/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ func ReaderParamEncoder(addr string) jsonrpc.Option {

if !redir {
go func() {
defer func() {
if rrr := recover(); rrr != nil {
log.Errorw("recovered panic in client-side ReaderParamEncoder io.Reader", "recover", rrr)
}
}()

// TODO: figure out errors here
for {
req, err := http.NewRequest("HEAD", u.String(), nil)
Expand Down

0 comments on commit b9bb01c

Please sign in to comment.