mirror of
https://github.com/zrepl/zrepl.git
synced 2025-01-24 07:09:07 +01:00
parent
4ee00091d6
commit
b2c5ffcaea
@ -146,12 +146,17 @@ func (s *Server) serveConn(nc *transport.AuthConn) {
|
|||||||
// if marshaling fails. We consider failed marshaling a handler error
|
// if marshaling fails. We consider failed marshaling a handler error
|
||||||
var protobuf *bytes.Buffer
|
var protobuf *bytes.Buffer
|
||||||
if handlerErr == nil {
|
if handlerErr == nil {
|
||||||
protobufBytes, err := proto.Marshal(res)
|
if res == nil {
|
||||||
if err != nil {
|
handlerErr = fmt.Errorf("implementation error: handler for endpoint %q returns nil error and nil result", endpoint)
|
||||||
s.log.WithError(err).Error("cannot marshal handler protobuf")
|
s.log.WithError(err).Error("handle implementation error")
|
||||||
handlerErr = err
|
} else {
|
||||||
|
protobufBytes, err := proto.Marshal(res)
|
||||||
|
if err != nil {
|
||||||
|
s.log.WithError(err).Error("cannot marshal handler protobuf")
|
||||||
|
handlerErr = err
|
||||||
|
}
|
||||||
|
protobuf = bytes.NewBuffer(protobufBytes) // SHADOWING
|
||||||
}
|
}
|
||||||
protobuf = bytes.NewBuffer(protobufBytes) // SHADOWING
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var resHeaderBuf bytes.Buffer
|
var resHeaderBuf bytes.Buffer
|
||||||
|
Loading…
Reference in New Issue
Block a user