Commit e6f6178b authored by u0x01's avatar u0x01

Mod: fix pkg/errors import & improve some err format

parent ff16ffe3
......@@ -250,7 +250,7 @@ func (t *gettyTCPConn) read(p []byte) (int, error) {
}
length, err = t.reader.Read(p)
log.Debug("now:%s, length:%d, err:%s", currentTime, length, err)
log.Debug("now:%s, length:%d, err:%v", currentTime, length, err)
atomic.AddUint32(&t.readBytes, uint32(length))
return length, perrors.WithStack(err)
//return length, err
......@@ -285,7 +285,7 @@ func (t *gettyTCPConn) Write(pkg interface{}) (int, error) {
if length, err = t.writer.Write(p); err == nil {
atomic.AddUint32(&t.writeBytes, (uint32)(len(p)))
}
log.Debug("now:%s, length:%d, err:%s", currentTime, length, err)
log.Debug("now:%s, length:%d, err:%v", currentTime, length, err)
return length, perrors.WithStack(err)
//return length, err
}
......
......@@ -11,9 +11,10 @@ package getty
import (
"compress/flate"
"errors"
"net"
"time"
perrors "github.com/pkg/errors"
)
// NewSessionCallback will be invoked when server accepts a new client connection or client connects to server successfully.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment