status-go/vendor/github.com/pion/stun/attributes_debug.go
Siddarth Kumar 926f6a3c72 Revert "test: bump go-libp2p"
This reverts commit d0ca4447c6c5642830354740d045f453eb3e77e8.
2024-01-18 20:29:33 +00:00

34 lines
603 B
Go

// +build debug
package stun
import "fmt"
// AttrOverflowErr occurs when len(v) > Max.
type AttrOverflowErr struct {
Type AttrType
Max int
Got int
}
func (e AttrOverflowErr) Error() string {
return fmt.Sprintf("incorrect length of %s attribute: %d exceeds maximum %d",
e.Type, e.Got, e.Max,
)
}
// AttrLengthErr means that length for attribute is invalid.
type AttrLengthErr struct {
Attr AttrType
Got int
Expected int
}
func (e AttrLengthErr) Error() string {
return fmt.Sprintf("incorrect length of %s attribute: got %d, expected %d",
e.Attr,
e.Got,
e.Expected,
)
}