MM-57391: improve error message (#26630)
The error reporte when moving channels and failing has been improved to show that the problem was the repeated name on the team. The error message has been unified with MM-53756 Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -745,7 +745,7 @@ func (s SqlChannelStore) updateChannelT(transaction *sqlxTxWrapper, channel *mod
|
||||
WHERE Id=:Id`, channel)
|
||||
if err != nil {
|
||||
if IsUniqueConstraintError(err, []string{"Name", "channels_name_teamid_key"}) {
|
||||
return nil, store.NewErrInvalidInput("Channel", "Name", channel.Name)
|
||||
return nil, store.NewErrUniqueConstraint("Name")
|
||||
}
|
||||
return nil, errors.Wrapf(err, "failed to update channel with id=%s", channel.Id)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user