@@ -10,7 +10,6 @@ import (
1010
1111 v1 "github.com/authzed/authzed-go/proto/authzed/api/v1"
1212
13- "github.com/authzed/spicedb/internal/sharederrors"
1413 dispatch "github.com/authzed/spicedb/pkg/proto/dispatch/v1"
1514 "github.com/authzed/spicedb/pkg/spiceerrors"
1615)
@@ -62,46 +61,6 @@ func NewAlwaysFailErr() error {
6261 }
6362}
6463
65- // RelationNotFoundError occurs when a relation was not found under a namespace.
66- type RelationNotFoundError struct {
67- error
68- namespaceName string
69- relationName string
70- }
71-
72- // NamespaceName returns the name of the namespace in which the relation was not found.
73- func (err RelationNotFoundError ) NamespaceName () string {
74- return err .namespaceName
75- }
76-
77- // NotFoundRelationName returns the name of the relation not found.
78- func (err RelationNotFoundError ) NotFoundRelationName () string {
79- return err .relationName
80- }
81-
82- func (err RelationNotFoundError ) MarshalZerologObject (e * zerolog.Event ) {
83- e .Err (err .error ).Str ("namespace" , err .namespaceName ).Str ("relation" , err .relationName )
84- }
85-
86- // DetailsMetadata returns the metadata for details for this error.
87- func (err RelationNotFoundError ) DetailsMetadata () map [string ]string {
88- return map [string ]string {
89- "definition_name" : err .namespaceName ,
90- "relation_or_permission_name" : err .relationName ,
91- }
92- }
93-
94- // NewRelationNotFoundErr constructs a new relation not found error.
95- func NewRelationNotFoundErr (nsName string , relationName string ) error {
96- return RelationNotFoundError {
97- error : fmt .Errorf ("relation/permission `%s` not found under definition `%s`" , relationName , nsName ),
98- namespaceName : nsName ,
99- relationName : relationName ,
100- }
101- }
102-
103- var _ sharederrors.UnknownRelationError = RelationNotFoundError {}
104-
10564// RelationMissingTypeInfoError defines an error for when type information is missing from a relation
10665// during a lookup.
10766type RelationMissingTypeInfoError struct {
0 commit comments