Skip to content

Commit 5ddb142

Browse files
authored
Fix misleading error messages (#117)
1 parent 13b3dd9 commit 5ddb142

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/datastore/memory.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (m *memoryDatastore[E]) Delete(ctx context.Context, id string) error {
5656

5757
_, ok := m.entities[id]
5858
if !ok {
59-
return NewNotFoundError(fmt.Sprintf("not found: delete of %s with id %s", m.entity, id))
59+
return NewNotFoundError(fmt.Sprintf("delete of %s with id %s", m.entity, id))
6060
}
6161
delete(m.entities, id)
6262

@@ -94,7 +94,7 @@ func (m *memoryDatastore[E]) Get(ctx context.Context, id string) (E, error) {
9494

9595
e, ok := m.entities[id]
9696
if !ok {
97-
return zero, NewNotFoundError(fmt.Sprintf("not found: delete of %s with id %s", m.entity, id))
97+
return zero, NewNotFoundError(fmt.Sprintf("get of %s with id %s", m.entity, id))
9898
}
9999

100100
return e, nil
@@ -123,7 +123,7 @@ func (m *memoryDatastore[E]) Update(ctx context.Context, ve E) error {
123123

124124
_, ok := m.entities[id]
125125
if !ok {
126-
return NewNotFoundError(fmt.Sprintf("not found: delete of %s with id %s", m.entity, id))
126+
return NewNotFoundError(fmt.Sprintf("update of %s with id %s", m.entity, id))
127127
}
128128

129129
m.entities[id] = ve

0 commit comments

Comments
 (0)