github.com/code-to-go/safepool.lib@v0.0.0-20221205180519-ee25e63c226e/core/errors.go (about) 1 package core 2 3 import ( 4 "fmt" 5 6 "github.com/sirupsen/logrus" 7 ) 8 9 var ErrNotInitialized = fmt.Errorf("safepool not initialized") 10 var ErrNoDriver = fmt.Errorf("no driver found for the provided configuration") 11 var ErrInvalidSignature = fmt.Errorf("signature does not match the user id") 12 var ErrInvalidSize = fmt.Errorf("provided slice has not enough data") 13 var ErrInvalidVersion = fmt.Errorf("version of protocol is not compatible") 14 var ErrInvalidChangeFilePath = fmt.Errorf("a change file is not in a valid Safepool folder") 15 var ErrInvalidFilePath = fmt.Errorf("a file is not in a valid Safepool folder") 16 var ErrNoExchange = fmt.Errorf("no exchange reachable for the domain") 17 var ErrNotAuthorized = fmt.Errorf("user is not authorized in the domain") 18 19 func IsErr(err error, msg string, args ...interface{}) bool { 20 if err != nil { 21 args = append(args, err) 22 logrus.Warnf(msg, args...) 23 return true 24 } 25 return false 26 }