Skip to content

Commit

Permalink
if->switch
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley committed Aug 17, 2023
1 parent 11a7cd2 commit 599d7c6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -989,16 +989,15 @@ func (cs *clientStream) finish(err error) {
cs.mu.Unlock()
// Only one of cancel or trailer needs to be logged.
if len(cs.binlogs) != 0 {
if err == errContextCanceled ||
err == errContextDeadline ||
err == ErrClientConnClosing {
switch err {
case errContextCanceled, errContextDeadline, ErrClientConnClosing:
c := &binarylog.Cancel{
OnClientSide: true,
}
for _, binlog := range cs.binlogs {
binlog.Log(cs.ctx, c)
}
} else {
default:
logEntry := &binarylog.ServerTrailer{
OnClientSide: true,
Trailer: cs.Trailer(),
Expand Down

0 comments on commit 599d7c6

Please sign in to comment.