mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-29 17:58:36 +08:00
mcclient error
This commit is contained in:
@@ -22,7 +22,7 @@ func newNameValidator(manager IModelManager, ownerProjId string, name string) er
|
||||
return err
|
||||
}
|
||||
if !isNameUnique(manager, ownerProjId, name) {
|
||||
return httperrors.NewConflictError(fmt.Sprintf("duplicate name %s", name))
|
||||
return httperrors.NewDuplicateNameError("name", name)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -44,7 +44,7 @@ func alterNameValidator(model IModel, name string) error {
|
||||
return err
|
||||
}
|
||||
if !isAlterNameUnique(model, name) {
|
||||
return httperrors.NewConflictError(fmt.Sprintf("duplicate name %s", name))
|
||||
return httperrors.NewDuplicateNameError("name", name)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ func (model *SVirtualResourceBase) PerformChangeOwner(ctx context.Context, userC
|
||||
q = q.Equals("tenant_id", tobj.GetId())
|
||||
q = q.NotEquals("id", model.GetId())
|
||||
if q.Count() > 0 {
|
||||
return nil, httperrors.NewConflictError(fmt.Sprintf("duplicate name %s", model.GetName()))
|
||||
return nil, httperrors.NewDuplicateNameError("name", model.GetName())
|
||||
}
|
||||
former, _ := TenantCacheManager.FetchTenantById(ctx, model.ProjectId)
|
||||
if former == nil {
|
||||
|
||||
Reference in New Issue
Block a user