Skip to content

Commit

Permalink
pipeline/task.bridge: ea status error can also be an object
Browse files Browse the repository at this point in the history
  • Loading branch information
brunotm committed Jan 19, 2024
1 parent 0c3894d commit 5d1351c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/services/pipeline/internal/eautils/eautils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion core/services/pipeline/task.bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (pr *adapterResponse) UnsetProviderStatusCode() {
}

func (pr *adapterResponse) SetError(msg string) {
pr.Error = &msg
pr.Error = msg
}

func (pr *adapterResponse) UnsetError() {
Expand Down

0 comments on commit 5d1351c

Please sign in to comment.