2020-09-30 14:36:27 +02:00
|
|
|
package storage
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type notFoundErr struct {
|
|
|
|
|
typ, id string
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-02 18:52:49 +01:00
|
|
|
func (e notFoundErr) Error() string {
|
2020-09-30 14:36:27 +02:00
|
|
|
return fmt.Sprintf("%s with id %s not found", e.typ, e.id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IsNotFoundErr can be returned by repo Load and Delete operations
|
|
|
|
|
func IsNotFoundErr(e error) bool {
|
|
|
|
|
_, ok := e.(*notFoundErr)
|
|
|
|
|
return ok
|
|
|
|
|
}
|