Skip to content

Commit

Permalink
with panic recover
Browse files Browse the repository at this point in the history
  • Loading branch information
tspiridonova committed Apr 13, 2021
1 parent 964f1a9 commit 34e7431
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/transport/http2_client.go
Expand Up @@ -387,6 +387,15 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts
return nil, err
}
go func() {
defer func() {
if r := recover(); r != nil {
if err != nil {
err = fmt.Errorf("%w; panic %v", err, r)
} else {
err = fmt.Errorf("panic %v", r)
}
}
}()
t.loopy = newLoopyWriter(clientSide, t.framer, t.controlBuf, t.bdpEst)
err := t.loopy.run()
if err != nil {
Expand Down

0 comments on commit 34e7431

Please sign in to comment.