diff --git a/flytepropeller/pkg/compiler/errors/compiler_error_test.go b/flytepropeller/pkg/compiler/errors/compiler_error_test.go index a86b14df06..8394ed5bb7 100644 --- a/flytepropeller/pkg/compiler/errors/compiler_error_test.go +++ b/flytepropeller/pkg/compiler/errors/compiler_error_test.go @@ -33,7 +33,7 @@ func TestErrorCodes(t *testing.T) { UnrecognizedValue: NewUnrecognizedValueErr("", ""), WorkflowBuildError: NewWorkflowBuildError(errors.New("")), NoNodesFound: NewNoNodesFoundErr(""), - InvalidLiteralTypeError: NewInvalidLiteralTypeErr("", ""), + InvalidLiteralTypeError: NewInvalidLiteralTypeErr("", "", errors.New("")), } for key, value := range testCases { diff --git a/flytepropeller/pkg/compiler/errors/compiler_errors.go b/flytepropeller/pkg/compiler/errors/compiler_errors.go index 3f3d780e89..b2e3796edd 100755 --- a/flytepropeller/pkg/compiler/errors/compiler_errors.go +++ b/flytepropeller/pkg/compiler/errors/compiler_errors.go @@ -221,10 +221,10 @@ func NewMismatchingVariablesErr(nodeID, fromVar, fromType, toVar, toType string) ) } -func NewInvalidLiteralTypeErr(nodeID, errMsg string) *CompileError { +func NewInvalidLiteralTypeErr(nodeID, inputVar string, err error) *CompileError { return newError( InvalidLiteralTypeError, - errMsg, + fmt.Sprintf("Failed to validate literal type for [%s] with err: %s", inputVar, err), nodeID, ) } diff --git a/flytepropeller/pkg/compiler/transformers/k8s/inputs.go b/flytepropeller/pkg/compiler/transformers/k8s/inputs.go index 7063ad3f2e..21250bd28d 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/inputs.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/inputs.go @@ -1,8 +1,6 @@ package k8s import ( - "fmt" - "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" @@ -47,8 +45,7 @@ func validateInputs(nodeID common.NodeID, iface *core.TypedInterface, inputs cor err := validators.ValidateLiteralType(inputType) if err != nil { - errMsg := fmt.Sprintf("Failed to validate literal type for [%s] with err: %s", inputVar, err) - errs.Collect(errors.NewInvalidLiteralTypeErr(nodeID, errMsg)) + errs.Collect(errors.NewInvalidLiteralTypeErr(nodeID, inputVar, err)) continue }