From 19b744388a785e99ae1e8f99a25489002f24e632 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Fri, 5 May 2023 14:20:40 -0700 Subject: [PATCH] Update pkg/common/flyte_url.go Co-authored-by: Haytham Abuelfutuh Signed-off-by: Yee Hing Tong --- pkg/common/flyte_url.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/common/flyte_url.go b/pkg/common/flyte_url.go index ec9a3ca08..9801994d4 100644 --- a/pkg/common/flyte_url.go +++ b/pkg/common/flyte_url.go @@ -47,10 +47,10 @@ func ParseFlyteURL(flyteURL string) (core.NodeExecutionIdentifier, *int, Artifac executionID := matches["exec"] nodeID := matches["node"] var attempt *int // nil means node execution, not a task execution - if matches["attempt"] != "" { - a, err := strconv.Atoi(matches["attempt"]) + if attempt := matches["attempt"]; len(attempt) > 0 { + a, err := strconv.Atoi(attempt) if err != nil { - return core.NodeExecutionIdentifier{}, nil, ArtifactTypeUndefined, fmt.Errorf("failed to parse attempt, %s", err) + return core.NodeExecutionIdentifier{}, nil, ArtifactTypeUndefined, fmt.Errorf("failed to parse attempt [%v], %v", attempt, err) } attempt = &a }