summaryrefslogtreecommitdiff
path: root/rudp/process.go
diff options
context:
space:
mode:
authoranon5 <anon5clam@protonmail.com>2021-02-20 16:31:06 +0000
committeranon5 <anon5clam@protonmail.com>2021-02-20 16:31:06 +0000
commit8b61ee961a9191fd2731a48d46f33b561a316032 (patch)
tree5d9423e8e0dafbc2fb2b4cf91266ec4bdd19b305 /rudp/process.go
parent14c04859a14edfe326d9664107707c0c1ae90dea (diff)
rudp: deprecate ErrClosed and replace with net.ErrClosed
Diffstat (limited to 'rudp/process.go')
-rw-r--r--rudp/process.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/rudp/process.go b/rudp/process.go
index c36af81..70c04a2 100644
--- a/rudp/process.go
+++ b/rudp/process.go
@@ -2,7 +2,6 @@ package rudp
import (
"encoding/binary"
- "encoding/hex"
"errors"
"fmt"
"io"
@@ -16,9 +15,7 @@ type PktError struct {
}
func (e PktError) Error() string {
- return "error processing " + e.Type + " pkt: " +
- hex.EncodeToString(e.Data) + ": " +
- e.Err.Error()
+ return fmt.Sprintf("error processing %s pkt: %x: %v", e.Type, e.Data, e.Err)
}
func (e PktError) Unwrap() error { return e.Err }
@@ -38,7 +35,7 @@ func (p *Peer) processNetPkts(pkts <-chan netPkt) {
type TrailingDataError []byte
func (e TrailingDataError) Error() string {
- return "trailing data: " + hex.EncodeToString([]byte(e))
+ return fmt.Sprintf("trailing data: %x", []byte(e))
}
func (p *Peer) processNetPkt(pkt netPkt) (err error) {