Skip to content

Commit

Permalink
Don't swallow duplicate key errror on phone update
Browse files Browse the repository at this point in the history
  • Loading branch information
AchoArnold committed Dec 5, 2023
1 parent 7638b92 commit 8d3a3cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/pkg/repositories/gorm_phone_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 8d3a3cd

Please sign in to comment.