Skip to content

Commit

Permalink
Don't overwrite UserVisibleError when updating selectors fails (#4334)
Browse files Browse the repository at this point in the history
We would return a UserVisibleError when updating selectors, but then
overwrite it in the caller who caled the validation, which resulted in
the server returning a 500 HTTP code to the client.
  • Loading branch information
jhrozek committed Aug 30, 2024
1 parent f6e1b9b commit b1f13f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/profiles/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (p *profileService) UpdateProfile(
}

if err := p.updateSelectors(ctx, updatedProfile.ID, qtx, profile.GetSelection()); err != nil {
return nil, status.Errorf(codes.Internal, "error updating profile: %v", err)
return nil, err
}

logger.BusinessRecord(ctx).Profile = logger.Profile{Name: updatedProfile.Name, ID: updatedProfile.ID}
Expand Down

0 comments on commit b1f13f9

Please sign in to comment.