~blu/artemis

74e046a6edfa1d89bbf2332bfb2b1cdeb045fe3d — Bryant Conquest 1 year, 4 months ago 14cce40
make error name follow conventions
1 files changed, 3 insertions(+), 3 deletions(-)

M cache/cache.go
M cache/cache.go => cache/cache.go +3 -3
@@ 31,7 31,7 @@ type CachedAsset struct {
	DiesAt      time.Time
}

var NotEnoughSpace = errors.New("not enough space on disk")
var ErrNotEnoughSpace = errors.New("not enough space on disk")

func NewCache() *Cache {
	return &Cache{


@@ 115,7 115,7 @@ func (c *Cache) freeCache(toFreeSpace uint64) error {
	}

	if toFreeSize < int(toFreeSpace) {
		return NotEnoughSpace
		return ErrNotEnoughSpace
	}

	for _, a := range toFree {


@@ 159,7 159,7 @@ func (c Cache) downloadAsset(path string) ([]byte, error) {

	if !avail {
		err := c.freeCache(uint64(len(data)))
		if errors.Is(err, NotEnoughSpace) {
		if errors.Is(err, ErrNotEnoughSpace) {
			return data, nil
		}