From 4f531b6946623d7c31dd4e2d0d20ea31ceb1cb1c Mon Sep 17 00:00:00 2001 From: akorotkov Date: Tue, 28 Jan 2025 13:36:08 +0200 Subject: [PATCH] error messages --- pkg/dto/backup_routine.go | 2 +- pkg/dto/validate_errors.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/dto/backup_routine.go b/pkg/dto/backup_routine.go index 3b587c0f..6398715a 100644 --- a/pkg/dto/backup_routine.go +++ b/pkg/dto/backup_routine.go @@ -51,7 +51,7 @@ type BackupRoutine struct { // Validate validates the backup routine configuration. func (r *BackupRoutine) Validate() error { if r.BackupPolicy == "" { - return errValidationEmptyField("backup policy") + return errValidationEmptyField("backup-policy") } if r.SourceCluster == "" { return errValidationEmptyField("source-cluster") diff --git a/pkg/dto/validate_errors.go b/pkg/dto/validate_errors.go index 835410c6..fa8fceb3 100644 --- a/pkg/dto/validate_errors.go +++ b/pkg/dto/validate_errors.go @@ -19,7 +19,7 @@ func errValidationMutuallyExclusive(field1, field2 string) error { } func errValidationEmptyField(field string) error { - return fmt.Errorf("%w: %q cannot be empty", errEmpty, field) + return fmt.Errorf("%w: %q required", errEmpty, field) } func errValidationNotFound(field, value string) error {