diff --git a/go-concourse/concourse/configs.go b/go-concourse/concourse/configs.go index 581ad53e3f2..c468bcbb50b 100644 --- a/go-concourse/concourse/configs.go +++ b/go-concourse/concourse/configs.go @@ -96,7 +96,11 @@ func (team *team) CreateOrUpdatePipelineConfig(pipelineRef atc.PipelineRef, conf var validationErr atc.SaveConfigResponse err = json.Unmarshal(body, &validationErr) if err != nil { - return false, false, []ConfigWarning{}, err + return false, false, []ConfigWarning{}, internal.UnexpectedResponseError{ + StatusCode: response.StatusCode, + Status: response.Status, + Body: string(body), + } } return false, false, []ConfigWarning{}, InvalidConfigError{Errors: validationErr.Errors} case http.StatusForbidden: diff --git a/go-concourse/concourse/configs_test.go b/go-concourse/concourse/configs_test.go index 2de9dc55b35..145a86d9735 100644 --- a/go-concourse/concourse/configs_test.go +++ b/go-concourse/concourse/configs_test.go @@ -378,6 +378,7 @@ var _ = Describe("ATC Handler Configs", func() { It("returns an error", func() { _, _, _, err := team.CreateOrUpdatePipelineConfig(pipelineRef, expectedVersion, expectedConfig, checkCredentials) Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("bad-json")) }) }) })