ICU-738/Refactor internal/db to domain errors (#815)
* Refactor internal/db to domain errors
This commit is contained in:
1 parent
b5d84495a3
commit
bfbb179741
82 files changed
+742
-640
No files matched your search
@@ -193,7 +193,7 @@ func (s Service) getFromRepo(ctx context.Context, id string) (*pb.User, error) {
|
||||
}
|
||||
u, accts, err := repo.LookupUser(ctx, id)
|
||||
if err != nil {
|
||||
if errors.Is(err, errors.ErrRecordNotFound) {
|
||||
if errors.IsNotFoundError(err) {
|
||||
return nil, handlers.NotFoundErrorf("User %q doesn't exist.", id)
|
||||
}
|
||||
return nil, err
|
||||
@@ -269,7 +269,7 @@ func (s Service) deleteFromRepo(ctx context.Context, id string) (bool, error) {
|
||||
}
|
||||
rows, err := repo.DeleteUser(ctx, id)
|
||||
if err != nil {
|
||||
if errors.Is(err, errors.ErrRecordNotFound) {
|
||||
if errors.IsNotFoundError(err) {
|
||||
return false, nil
|
||||
}
|
||||
return false, fmt.Errorf("unable to delete user: %w", err)
|
||||
|
||||
Reference in new issue
Block a user