Skip to content

Commit

Permalink
Correct error message to differentiate the cause
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
savitaashture authored and tekton-robot committed Jul 4, 2024
1 parent fbef03d commit 4954e0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1beta1/task_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4954e0c

Please sign in to comment.