mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-06-03 05:49:40 +00:00
23 lines
510 B
Go
23 lines
510 B
Go
|
package result
|
||
|
|
||
|
import "errors"
|
||
|
|
||
|
// ErrUnkownLookup ...
|
||
|
var ErrUnknownLookup = errors.New("unknown lookup identifier")
|
||
|
|
||
|
// IsConflictErr returns whether error is due to key conflict.
|
||
|
func IsConflictErr(err error) bool {
|
||
|
_, ok := err.(ConflictError)
|
||
|
return ok
|
||
|
}
|
||
|
|
||
|
// ConflictError is returned on cache key conflict.
|
||
|
type ConflictError struct {
|
||
|
Key string
|
||
|
}
|
||
|
|
||
|
// Error returns the message for this key conflict error.
|
||
|
func (c ConflictError) Error() string {
|
||
|
return "cache conflict for key \"" + c.Key + "\""
|
||
|
}
|