From a1cd4624c3f6a20f13e5b948db0ca4f01dbb0902 Mon Sep 17 00:00:00 2001 From: Blake Devcich Date: Tue, 26 Sep 2023 13:04:45 -0500 Subject: [PATCH] Added better error message for copy-in/copy-out errors Signed-off-by: Blake Devcich --- controllers/nnf_workflow_controller.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/controllers/nnf_workflow_controller.go b/controllers/nnf_workflow_controller.go index 41b6586f6..66475a0b8 100644 --- a/controllers/nnf_workflow_controller.go +++ b/controllers/nnf_workflow_controller.go @@ -759,10 +759,13 @@ func (r *NnfWorkflowReconciler) finishDataInOutState(ctx context.Context, workfl } // Check results of data movement operations - // TODO: Detailed Fail Message? for _, dm := range dataMovementList.Items { if dm.Status.Status != nnfv1alpha1.DataMovementConditionReasonSuccess { - handleWorkflowErrorByIndex(dwsv1alpha2.NewResourceError("").WithUserMessage("data movement operation failed").WithFatal(), workflow, index) + // include the whole output for debugMsg; instruct user to look at the nnfdatamovement resource + debugMsg := fmt.Sprintf("%s:%s", dm.Status.Error.DebugMessage, dm.Status.Error.UserMessage) + userMsg := fmt.Sprintf("data movement operation failed: see %s/%s resource in the '%s' namespace for error details", + dm.Kind, dm.Name, dm.Namespace) + handleWorkflowErrorByIndex(dwsv1alpha2.NewResourceError(debugMsg).WithUserMessage(userMsg).WithFatal(), workflow, index) return Requeue("error").withObject(&dm), nil } }