Fixed error message when trying to change prio to a used number.

This commit is contained in:
Magnus Åhall 2024-07-04 19:38:36 +02:00
parent 06f88f697c
commit e10783ec54

View File

@ -101,7 +101,7 @@ func UpdateNotificationService(svc notification.Service) (created bool, err erro
// Check if this is just a duplicated prio, which isn't allowed. // Check if this is just a duplicated prio, which isn't allowed.
pgErr, isPgErr := err.(*pq.Error) pgErr, isPgErr := err.(*pq.Error)
if isPgErr && pgErr.Code == "23505" { if isPgErr && pgErr.Code == "23505" {
return false, werr.New("Prio %d is already used by another service", svc.GetPrio()) return false, werr.New("Prio %d is already used by another service", svc.Updated().GetPrio())
} }
return false, werr.Wrap(err).WithData( return false, werr.Wrap(err).WithData(