mox/moxio/storagespace.go

15 lines
326 B
Go
Raw Permalink Normal View History

2023-01-30 16:27:06 +03:00
package moxio
import (
"errors"
"syscall"
)
// In separate file because of syscall import.
// IsStorageSpace returns whether the error is for storage space issue.
// Like disk full, no inodes, quota reached.
func IsStorageSpace(err error) bool {
return errors.Is(err, syscall.ENOSPC) || errors.Is(err, syscall.EDQUOT)
}