MSP-5013 change variable error

This commit is contained in:
komissarovyv committed 2025-03-24 15:26:59 +03:00
1 parent f63bf4a9f1
commit ab95da7242
2 files changed
+1 -3

No files matched your search

+1 -1
View File
@@ -139,7 +139,7 @@ func (c Variable) Upsert(ctx context.Context, req []domain.UpsertVariableRequest
func (c Variable) Delete(ctx context.Context, req domain.VariableByNameRequest) error {
err := c.service.Delete(ctx, req.Name)
switch {
case errors.Is(err, entity.ErrConfigNotFound):
case errors.Is(err, entity.ErrVariableNotFound):
return apierrors.NewBusinessError(domain.ErrorCodeVariableNotFound, "variable by name not found", err)
case errors.Is(err, entity.ErrVariableUsedInConfigs):
return apierrors.NewBusinessError(domain.ErrorCodeVariableUsedInConfigs, "variable used in configs", err)