From 8d3a3cdea27b191334eab655512fa6b3affe0f49 Mon Sep 17 00:00:00 2001 From: Acho Arnold Date: Tue, 5 Dec 2023 21:01:30 +0200 Subject: [PATCH] Don't swallow duplicate key errror on phone update --- api/pkg/repositories/gorm_phone_repository.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/pkg/repositories/gorm_phone_repository.go b/api/pkg/repositories/gorm_phone_repository.go index 9d37c731..86c0bfef 100644 --- a/api/pkg/repositories/gorm_phone_repository.go +++ b/api/pkg/repositories/gorm_phone_repository.go @@ -81,7 +81,7 @@ func (repository *gormPhoneRepository) Save(ctx context.Context, phone *entities WithContext(ctx). Save(phone). Error - if err != nil && !errors.Is(err, gorm.ErrDuplicatedKey) { + if err != nil { msg := fmt.Sprintf("cannot save phone with ID [%s]", phone.ID) return repository.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg)) }