mirror of
https://github.com/libp2p/go-libp2p-resource-manager.git
synced 2026-08-22 19:43:28 +08:00
more descriptive invalid buffer error in Grow
This commit is contained in:
2
scope.go
2
scope.go
@@ -113,7 +113,7 @@ func (rc *Resources) growBuffer(oldbuf []byte, newsize int) ([]byte, error) {
|
||||
|
||||
_, ok := rc.buffers[oldbuf]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("cannot grow unknown buffer")
|
||||
return nil, fmt.Errorf("invalid buffer; cannot grow buffer not allocated through this scope")
|
||||
}
|
||||
|
||||
newbuf := pool.Get(newsize)
|
||||
|
||||
Reference in New Issue
Block a user