From 53f42fa5c1cef7012088703498e26b155c544f64 Mon Sep 17 00:00:00 2001 From: Ioan Damian Date: Thu, 12 Sep 2024 09:28:16 +0200 Subject: [PATCH] none : --- internal/awx/resource_job_template_launch.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/awx/resource_job_template_launch.go b/internal/awx/resource_job_template_launch.go index d557ec08..2157bde4 100644 --- a/internal/awx/resource_job_template_launch.go +++ b/internal/awx/resource_job_template_launch.go @@ -128,11 +128,10 @@ func resourceJobTemplateLaunchCreate(ctx context.Context, d *schema.ResourceData if d.Get("wait_for_completion").(bool) { err = jobTemplateLaunchWait(ctx, client.JobService, res, d.Timeout(schema.TimeoutCreate)) - if err != nil { - errString := err.Error() // Explicitly force err to string + if len(err.Error()) > 0 { return utils.Diagf( "JobTemplate execution failure", - fmt.Sprintf("JobTemplateLaunch with ID %d and template ID %d, failed to complete %s", res.ID, d.Get("job_template_id").(int), errString), + fmt.Sprintf("JobTemplateLaunch with ID %d and template ID %d, failed to complete %s", res.ID, d.Get("job_template_id").(int), err.Error()), ) } }