Skip to content

Commit

Permalink
Improve Agent Terminal Phase Error Message (flyteorg#4935)
Browse files Browse the repository at this point in the history
  • Loading branch information
Future-Outlier authored and yubofredwang committed Mar 26, 2024
1 parent d3239a3 commit f0753a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flyteplugins/go/tasks/plugins/webapi/agent/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 {
Expand Down

0 comments on commit f0753a5

Please sign in to comment.