From cf992f5950a2bdcd0f02a55c7aa17cee7d2d3df5 Mon Sep 17 00:00:00 2001 From: Future-Outlier Date: Fri, 23 Feb 2024 16:58:29 +0800 Subject: [PATCH] Improve Agent Terminal Phase Error Message (#4935) --- flyteplugins/go/tasks/plugins/webapi/agent/plugin.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go b/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go index 13115f89b4..b7d33f0b26 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go @@ -184,9 +184,9 @@ func (p Plugin) Status(ctx context.Context, taskCtx webapi.StatusContext) (phase } return core.PhaseInfoSuccess(taskInfo), nil case flyteIdl.TaskExecution_ABORTED: - return core.PhaseInfoFailure(pluginErrors.TaskFailedWithError, "failed to run the job with aborted phase", taskInfo), nil + return core.PhaseInfoFailure(pluginErrors.TaskFailedWithError, "failed to run the job with aborted phase.\n"+resource.Message, taskInfo), nil case flyteIdl.TaskExecution_FAILED: - return core.PhaseInfoFailure(pluginErrors.TaskFailedWithError, "failed to run the job", taskInfo), nil + return core.PhaseInfoFailure(pluginErrors.TaskFailedWithError, "failed to run the job.\n"+resource.Message, taskInfo), nil } // The default phase is undefined. @@ -201,9 +201,9 @@ func (p Plugin) Status(ctx context.Context, taskCtx webapi.StatusContext) (phase case admin.State_RUNNING: return core.PhaseInfoRunning(core.DefaultPhaseVersion, taskInfo), nil case admin.State_PERMANENT_FAILURE: - return core.PhaseInfoFailure(pluginErrors.TaskFailedWithError, "failed to run the job", taskInfo), nil + return core.PhaseInfoFailure(pluginErrors.TaskFailedWithError, "failed to run the job.\n"+resource.Message, taskInfo), nil case admin.State_RETRYABLE_FAILURE: - return core.PhaseInfoRetryableFailure(pluginErrors.TaskFailedWithError, "failed to run the job", taskInfo), nil + return core.PhaseInfoRetryableFailure(pluginErrors.TaskFailedWithError, "failed to run the job.\n"+resource.Message, taskInfo), nil case admin.State_SUCCEEDED: err = writeOutput(ctx, taskCtx, resource) if err != nil {