From c888f812a3d5ec6f607c6601b1b10a445a4c4d4d Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Mon, 21 Jun 2021 00:52:34 -0700 Subject: [PATCH] internal/provider: include image name in error message (#223) Without this, if the Docker image is not found, it's difficult to know which image exactly is 404'ing - you get a very generic error message, which can make it difficult to spot typos or other problems with the image name. Co-authored-by: Manuel Vogel --- internal/provider/data_source_docker_registry_image.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/data_source_docker_registry_image.go b/internal/provider/data_source_docker_registry_image.go index e9cadcf0..2fbdebcb 100644 --- a/internal/provider/data_source_docker_registry_image.go +++ b/internal/provider/data_source_docker_registry_image.go @@ -80,7 +80,7 @@ func dataSourceDockerRegistryImageRead(ctx context.Context, d *schema.ResourceDa if err != nil { digest, err = getImageDigest(pullOpts.Registry, pullOpts.Repository, pullOpts.Tag, username, password, insecureSkipVerify, true) if err != nil { - return diag.Errorf("Got error when attempting to fetch image version from registry: %s", err) + return diag.Errorf("Got error when attempting to fetch image version %s:%s from registry: %s", pullOpts.Repository, pullOpts.Tag, err) } }