Skip to content

Commit

Permalink
Merge pull request #2 from No-SilverBullet/fix/issue103
Browse files Browse the repository at this point in the history
refactor: error format in WritePkg method
  • Loading branch information
No-SilverBullet authored May 28, 2024
2 parents 31379a1 + fd6e766 commit 01362ff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,8 @@ func (s *session) WritePkg(pkg interface{}, timeout time.Duration) (pkgBytesLent
const size = 64 << 10
rBuf := make([]byte, size)
rBuf = rBuf[:runtime.Stack(rBuf, false)]
errMsg := fmt.Sprintf("[session.WritePkg] panic session %s: err=%s\n%s", s.sessionToken(), r, rBuf)
log.Error(errMsg)
err = perrors.WithStack(fmt.Errorf(errMsg))
err = perrors.WithStack(fmt.Errorf("[session.WritePkg] panic session %s: err=%v\n%s", s.sessionToken(), r, rBuf))
log.Error(err)
}
}()

Expand Down

0 comments on commit 01362ff

Please sign in to comment.