From 950883321ba4fa8aad7d50a190582f812f3b2c8b Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Sat, 4 Mar 2023 11:46:20 +0800 Subject: [PATCH] Improve error message (#532) Signed-off-by: Kevin Su --- pkg/manager/impl/validation/execution_validator.go | 2 +- pkg/manager/impl/validation/execution_validator_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/manager/impl/validation/execution_validator.go b/pkg/manager/impl/validation/execution_validator.go index 8db798eb0..73c31e1cc 100644 --- a/pkg/manager/impl/validation/execution_validator.go +++ b/pkg/manager/impl/validation/execution_validator.go @@ -104,7 +104,7 @@ func CheckAndFetchInputsForExecution( } else { inputType := validators.LiteralTypeForLiteral(executionInputMap[name]) if !validators.AreTypesCastable(inputType, expectedInput.GetVar().GetType()) { - return nil, errors.NewFlyteAdminErrorf(codes.InvalidArgument, "invalid %s input wrong type", name) + return nil, errors.NewFlyteAdminErrorf(codes.InvalidArgument, "invalid %s input wrong type. Expected %s, but got %s", name, expectedInput.GetVar().GetType(), inputType) } } } diff --git a/pkg/manager/impl/validation/execution_validator_test.go b/pkg/manager/impl/validation/execution_validator_test.go index 0af0ebfde..3aac99451 100644 --- a/pkg/manager/impl/validation/execution_validator_test.go +++ b/pkg/manager/impl/validation/execution_validator_test.go @@ -99,7 +99,7 @@ func TestValidateExecInputsWrongType(t *testing.T) { lpRequest.Spec.FixedInputs, lpRequest.Spec.DefaultInputs, ) - assert.EqualError(t, err, "invalid foo input wrong type") + assert.EqualError(t, err, "invalid foo input wrong type. Expected simple:STRING , but got simple:INTEGER ") } func TestValidateExecInputsExtraInputs(t *testing.T) {