From a1c6ad934e25889f037a9cfe22de8f8df525e9e5 Mon Sep 17 00:00:00 2001 From: savitaashture Date: Thu, 6 Jun 2024 13:10:27 +0530 Subject: [PATCH] Correct error message to differentiate the cause As the same error message is used for both serializeTask and deserializeTask, it will be difficult to determine which function is causing the error. Signed-off-by: Savita Ashture --- pkg/apis/pipeline/v1beta1/task_conversion.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apis/pipeline/v1beta1/task_conversion.go b/pkg/apis/pipeline/v1beta1/task_conversion.go index 4c026e10b60..aa3eac77539 100644 --- a/pkg/apis/pipeline/v1beta1/task_conversion.go +++ b/pkg/apis/pipeline/v1beta1/task_conversion.go @@ -212,7 +212,7 @@ func serializeTaskDeprecations(meta *metav1.ObjectMeta, spec *TaskSpec, taskName existingDeprecations := taskDeprecations{} if str, ok := meta.Annotations[TaskDeprecationsAnnotationKey]; ok { if err := json.Unmarshal([]byte(str), &existingDeprecations); err != nil { - return fmt.Errorf("error deserializing key %s from metadata: %w", TaskDeprecationsAnnotationKey, err) + return fmt.Errorf("error serializing key %s from metadata: %w", TaskDeprecationsAnnotationKey, err) } } if taskDeprecation != nil {