Files
opencloud/extensions/accounts/pkg/storage/errors.go
Christian Richter 2089ac5f7b refactor accounts
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-04-13 17:04:35 +02:00

20 lines
325 B
Go

package storage
import (
"fmt"
)
type notFoundErr struct {
typ, id string
}
func (e notFoundErr) Error() string {
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
}