Commit ea6ff4c5 authored by AlexStocks's avatar AlexStocks

juju/errors instead of pkg/errors

parent 1998bbf8
......@@ -14,11 +14,15 @@
## develop history ##
---
- 2018/03/18
- 2018/03/29
> improvement
* use juju/errors instead of pkg/errors
- 2018/03/20
> bug fix
* ignore connectPingPackage
- 2018/03/18
- 2018/03/19
> improvement
* use gxnet.IsSameAddr
* send out pkg asap in WritePkg when the second parameter @timeout is not greater then 0.
......
......@@ -27,7 +27,7 @@ import (
"github.com/AlexStocks/goext/time"
log "github.com/AlexStocks/log4go"
"github.com/gorilla/websocket"
"github.com/pkg/errors"
"github.com/juju/errors"
)
var (
......
......@@ -26,7 +26,7 @@ import (
"github.com/AlexStocks/goext/time"
log "github.com/AlexStocks/log4go"
"github.com/gorilla/websocket"
"github.com/pkg/errors"
"github.com/juju/errors"
)
const (
......@@ -342,7 +342,7 @@ func (s *session) WriteBytes(pkg []byte) error {
// s.conn.SetWriteTimeout(time.Now().Add(s.wTimeout))
if _, err := s.Connection.Write(pkg); err != nil {
return errors.Wrapf(err, "s.Connection.Write(pkg len:%d)", len(pkg))
return errors.Annotatef(err, "s.Connection.Write(pkg len:%d)", len(pkg))
}
s.incWritePkgNum()
......@@ -673,7 +673,7 @@ func (s *session) handleUDPPackage() error {
}
if err != nil {
log.Error("%s, [session.handleUDPPackage] = len{%d}, error{%s}", s.sessionToken(), bufLen, err)
err = errors.Wrapf(err, "conn.read()")
err = errors.Annotatef(err, "conn.read()")
break
}
......
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