From 87426cb5b688ed39f3b40603c8a21f345b278368 Mon Sep 17 00:00:00 2001 From: Louis TOUSSAINT Date: Wed, 2 Jun 2021 17:39:01 +0200 Subject: [PATCH] Issue 494: Fix error reporting in http state reader --- pkg/iac/terraform/state/backend/http_reader.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/iac/terraform/state/backend/http_reader.go b/pkg/iac/terraform/state/backend/http_reader.go index ccd5e28c..7d97d0e3 100644 --- a/pkg/iac/terraform/state/backend/http_reader.go +++ b/pkg/iac/terraform/state/backend/http_reader.go @@ -46,7 +46,11 @@ func (h *HTTPBackend) Read(p []byte) (n int, err error) { return 0, errors.Errorf("error requesting HTTP(s) backend state: status code: %d", res.StatusCode) } } - return h.reader.Read(p) + read, err := h.reader.Read(p) + if err != nil { + return 0, err + } + return read, nil } func (h *HTTPBackend) Close() error {