From 5d1351ce053433da818291de21497ed61e6fb982 Mon Sep 17 00:00:00 2001 From: Bruno Moura Date: Fri, 12 Jan 2024 17:19:15 +0000 Subject: [PATCH] pipeline/task.bridge: ea status error can also be an object --- core/services/pipeline/internal/eautils/eautils.go | 4 ++-- core/services/pipeline/task.bridge_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/services/pipeline/internal/eautils/eautils.go b/core/services/pipeline/internal/eautils/eautils.go index 490a5de1725..30faa826b22 100644 --- a/core/services/pipeline/internal/eautils/eautils.go +++ b/core/services/pipeline/internal/eautils/eautils.go @@ -7,7 +7,7 @@ import ( type AdapterStatus struct { ErrorMessage *string `json:"errorMessage"` - Error *string `json:"error"` + Error any `json:"error"` StatusCode *int `json:"statusCode"` ProviderStatusCode *int `json:"providerStatusCode"` } @@ -31,7 +31,7 @@ func BestEffortExtractEAStatus(responseBytes []byte) (code int, ok bool) { return *status.ProviderStatusCode, true } - if status.Error != nil && *status.Error != "" { + if status.Error != nil { return http.StatusInternalServerError, true } diff --git a/core/services/pipeline/task.bridge_test.go b/core/services/pipeline/task.bridge_test.go index 263d90c561e..7673add1e35 100644 --- a/core/services/pipeline/task.bridge_test.go +++ b/core/services/pipeline/task.bridge_test.go @@ -80,7 +80,7 @@ func (pr *adapterResponse) UnsetProviderStatusCode() { } func (pr *adapterResponse) SetError(msg string) { - pr.Error = &msg + pr.Error = msg } func (pr *adapterResponse) UnsetError() {